Skip to content

Instantly share code, notes, and snippets.

@cursorial
Created April 17, 2021 20:17
Show Gist options
  • Save cursorial/d0a168738d601895c7ce4ae05eef57ae to your computer and use it in GitHub Desktop.
Save cursorial/d0a168738d601895c7ce4ae05eef57ae to your computer and use it in GitHub Desktop.
Get Instagram Query Hashes
const updateQueryHashes = () => {
let urlManifest = window.__s.js
let urlManifestKeys = Object.keys(urlManifest)
let consumerFilePathKey = urlManifestKeys.filter((key) => {
return urlManifest[key].includes('Consumer.js')
})
let consumerFilePath = urlManifest[consumerFilePathKey]
fetch(consumerFilePath)
.then(res => res.text())
.then(data => {
const hashes = [...data.matchAll(/["][a-z0-9]{32}["]/g)]
postLikesQueryHash = hashes[5][0].replaceAll('"', '')
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment