Skip to content

Instantly share code, notes, and snippets.

@andris9
Created January 31, 2022 17:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andris9/b5cc64b6e9391456f9c0e5791ac25a4c to your computer and use it in GitHub Desktop.
Save andris9/b5cc64b6e9391456f9c0e5791ac25a4c to your computer and use it in GitHub Desktop.
"use strict";
const fs = require("fs");
const http = require("http");
const API_PATH = "http://127.0.0.1:3000";
const ACCESS_TOKEN = "b2d73a529d602c0c9dfec62227a22151af04ca45227a7c7f5e24c35a6b004584";
const ACCOUNT_ID = "ekiri";
const ATTACHMENT_ID = "AAAAAQAABPsy";
http.get(
`${API_PATH}/v1/account/${ACCOUNT_ID}/attachment/${ATTACHMENT_ID}`,
{
headers: {
Authorization: `Bearer ${ACCESS_TOKEN}`,
},
},
(res) => {
res.pipe(fs.createWriteStream("screenshot.png"));
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment