Skip to content

Instantly share code, notes, and snippets.

@huggler
Created May 18, 2021 16:07
Show Gist options
  • Save huggler/d70ba621acd20e07ee3899d5294146ba to your computer and use it in GitHub Desktop.
Save huggler/d70ba621acd20e07ee3899d5294146ba to your computer and use it in GitHub Desktop.
instagram image to base64
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