Skip to content

Instantly share code, notes, and snippets.

View acoyfellow's full-sized avatar
🤖
Building

Jordan Coeyman acoyfellow

🤖
Building
View GitHub Profile
document.querySelectorAll('.FriendRequestAdd.addButton').forEach(function(btn){
btn.click()
});
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;
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/',
];
@acoyfellow
acoyfellow / Mass LinkedIn Connect (with limit)
Created May 5, 2017 11:42
Mass LinkedIn Connect (with limit)
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){
@acoyfellow
acoyfellow / instaGet
Created May 10, 2017 18:59 — forked from lkLeonov/instaGet
How to get media from instagram via XHR
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)
@acoyfellow
acoyfellow / xhr_insta.js
Created May 11, 2017 14:49
XHR INSTA example
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)
@acoyfellow
acoyfellow / script.js
Last active October 20, 2023 18:03
XHR IG login
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");
@acoyfellow
acoyfellow / How to install OptKit on Optimizely
Last active October 28, 2017 21:13
Be sure to modify YOUR_WEBSITE_ID on line 34
/*
* 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.
*
*/
@acoyfellow
acoyfellow / index.js
Created November 4, 2017 17:49
requirebin sketch
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);
}
@acoyfellow
acoyfellow / infusionsoft-params-inject.html
Last active May 9, 2020 14:13
Email must be pre-populated (from InfusionSoft server-side, or via url search parameters). Also store affiliate into cookies if it's there.
<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, " "));
};