This file contains 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
function sleep(ms) { | |
return new Promise(resolve => setTimeout(resolve, ms)); | |
} | |
async function connect(profile, i) { | |
try { | |
const a=document.querySelector(`#${profile.id} a`); | |
if(a===null){ | |
run(); | |
return; |
This file contains 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
var urls= [ | |
'https://www.linkedin.com/in/coeyman/', | |
'https://www.linkedin.com/in/coeyman/', | |
'https://www.linkedin.com/in/coeyman/', | |
'https://www.linkedin.com/in/coeyman/', | |
'https://www.linkedin.com/in/coeyman/', | |
'https://www.linkedin.com/in/coeyman/', | |
'https://www.linkedin.com/in/coeyman/', | |
]; |
This file contains 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
var maximumTries= 200, runCount=0; | |
var timer= setInterval(e=>{ | |
if(maximumTries==maximumTries){ | |
clearInterval(timer) | |
}else{ | |
runCount++ | |
}; | |
document.querySelectorAll('.search-result__actions--primary.button-secondary-medium.m5').forEach(btn=> { | |
if(btn.innerHTML.indexOf('Connect')==-1){ |
This file contains 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
function getMedia(instaData, mediaCount, callback) { | |
var profileData = instaData.entry_data.ProfilePage[0]; | |
var userID = profileData.user.id; | |
var totalMedia = profileData.user.media.count; | |
var mediaCount = mediaCount > totalMedia ? totalMedia : mediaCount; | |
var csrf_token = instaData.config.csrf_token; | |
var xhrBody = "ig_user(" + userID + ") { media.after(0, " + mediaCount + ") {nodes {display_src }}}"; | |
var xhr = new XMLHttpRequest(); | |
xhr.open("POST", '/query/', true) |
This file contains 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
function getMedia(instaData, mediaCount, callback) { | |
var profileData = instaData.entry_data.FeedPage[0].graphql.user; | |
var userID = profileData.user.id; | |
var totalMedia = profileData.user.media.count; | |
var mediaCount = mediaCount > totalMedia ? totalMedia : mediaCount; | |
var csrf_token = instaData.config.csrf_token; | |
var xhrBody = "ig_user(" + userID + ") { media.after(0, " + mediaCount + ") {nodes {display_src }}}"; | |
var xhr = new XMLHttpRequest(); | |
xhr.open("POST", '/query/', true) |
This file contains 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
var params = "username=username&password=password"; | |
new Promise(function (resolve, reject) { | |
var http = new XMLHttpRequest(); | |
http.open("POST", "https://www.instagram.com/accounts/login/ajax/", true); | |
http.setRequestHeader('x-csrftoken', window._sharedData.config.csrf_token); | |
http.setRequestHeader('x-instagram-ajax', '1'); | |
http.setRequestHeader('x-requested-with', 'XMLHttpRequest'); | |
http.setRequestHeader("pragma", "no-cache"); | |
http.setRequestHeader("cache-control", "no-cache"); |
This file contains 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
/* | |
* Usage | |
* This function will append an external OptKit JavaScript to the head of the document. | |
* | |
* @param {String} location - The location of the file you'd like to load. | |
* @param {String} website_id - The OptKit website ID you'd like to load on this variation. | |
* @param {Function} callback - [OPTIONAL] A function to call when the script has completed downloading. | |
* | |
*/ |
This file contains 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
const Moment = require('moment'); | |
const MomentRange = require('moment-range'); | |
const moment = MomentRange.extendMoment(Moment); | |
let now= moment(); | |
const range = moment.range(now, now.subtract(30, 'days')); | |
for (let day of range.by('day')) { | |
console.log(day); | |
} |
This file contains 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
<script> | |
function getParameterByName(name, url) { | |
if (!url) url = window.location.href; | |
name = name.replace(/[\[\]]/g, "\\$&"); | |
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), | |
results = regex.exec(url); | |
if (!results) return null; | |
if (!results[2]) return ''; | |
return decodeURIComponent(results[2].replace(/\+/g, " ")); | |
}; |