Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>My App</title>
</head>
<body>
<script src='main.js'></script>
</body>
</html>
{
"name": "my-app",
"version": "1.0.0",
"private": true,
"license": "MIT",
"dependencies": {
"webpack": "^5.45.0",
"webpack-cli": "^4.7.2"
}
}
alert('hello, webpack world!')
{
"name": "my-app",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"webpack": "^5.45.0",
"webpack-cli": "^4.7.2"
}
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>My App</title>
</head>
<body>
<script src='./src/index.js'></script>
</body>
</html>
@cursorial
cursorial / instagram-follow-users.js
Last active April 17, 2021 20:44
Follow users at random intervals
const random = (min, max) => {
return Math.random() * (max - min) + min;
}
const data = [/* user id array */]
data.map((item, index) => {
setTimeout(() => followUser(item), random(60000, 120000) * index)
})
@cursorial
cursorial / instagram_csrf_token.js
Created April 17, 2021 20:34
Get CSRF token on Instagram
const getCookieObject = () => {
let obj = {}
document.cookie.split(';').map((item) => {
const keyValArray = item.split('=')
try {
const key = keyValArray[0].trim()
const val = keyValArray[1].trim()
obj[key] = val
} catch (e) {}
})
@cursorial
cursorial / follow_user.js
Created April 17, 2021 20:30
Follow user
const requestHeaders = [
{
name: 'accept',
value: '*/*'
},
{
name: 'accept-language',
value: 'en-US;q=0.9,en;q=0.8'
},
{
@cursorial
cursorial / update_query_hashes.js
Created April 17, 2021 20:17
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 => {
@cursorial
cursorial / instagram_post_likes.js
Created April 17, 2021 19:29
Get Instagram Post Likes
const write = (arr) => { /* utility function to write our array of user id's somewhere */ }
const getGraphqlUrl = (queryHash, variables) => {
return `https://www.instagram.com/graphql/query/?query_hash=${queryHash}&variables=${encodeURIComponent(JSON.stringify(variables))}`
}
const getPageRequest = ({
err,
res,
body,