Created
January 31, 2022 17:38
-
-
Save andris9/b5cc64b6e9391456f9c0e5791ac25a4c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"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