Created
May 18, 2021 16:07
-
-
Save huggler/d70ba621acd20e07ee3899d5294146ba to your computer and use it in GitHub Desktop.
instagram image to base64
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
for await (const item of resp.user.edge_owner_to_timeline_media.edges) { | |
var base64 = await Jimp.read(encodeURI(item.node.display_url)).then(image => image.getBase64Async(Jimp.AUTO)).then(base64 => base64); | |
data.push({ | |
id: item.node.id, | |
display_url: base64, | |
shortcode: item.node.shortcode, | |
text: item.node.edge_media_to_caption.edges[0].node.text | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment