Skip to content

Instantly share code, notes, and snippets.

@rdlh
Created August 2, 2018 14:14
Show Gist options
  • Save rdlh/bb556cf80a5cdcf457079c30055f0fea to your computer and use it in GitHub Desktop.
Save rdlh/bb556cf80a5cdcf457079c30055f0fea to your computer and use it in GitHub Desktop.
HD Instagram Profile Picture
function fetchInstagramId(callback) {
fetch('https://i.instagram.com/api/v1/users/' + window._sharedData.entry_data.ProfilePage[0].graphql.user.id + '/info/')
.then(response => response.json())
.then(json => callback(json))
.catch(error => callback(error, null))
}
function fetchHdProfilePicture() {
fetchInstagramId(function(data) {
window.open(data.user.hd_profile_pic_url_info.url)
})
}
fetchHdProfilePicture()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment