Skip to content

Instantly share code, notes, and snippets.

@youminkim
Last active June 24, 2016 08:25
Show Gist options
  • Save youminkim/60ac9b76502f48370240 to your computer and use it in GitHub Desktop.
Save youminkim/60ac9b76502f48370240 to your computer and use it in GitHub Desktop.
Pinterest Hack
var seconds = 3600/100; // hour limit 300
var move = 150;
// selectors
var sel_like = 'button.LikeButton.rounded.PinLikeButton.Button:not(.unlike)';
var sel_board = 'Button.hasText.btn.rounded.Button.boardFollowUnfollowButton:not(.dim)';
var sel_follow = 'button.UserFollowButton.btn.rounded.Button:not(.dim)';
function click(sel, n){
e=document.createEvent('HTMLEvents');
e.initEvent('click',true,true);
bs=document.querySelectorAll(sel)[0].dispatchEvent(e);
console.log(n);
window.scroll(0,n*move);
setTimeout(function() {
click(sel, n+1);
}, seconds*1000);
}
//click(sel_follow, 0);
//click(sel_board, 0);
//click(sel_like, 0)
var addresses = [ ... ];
function invite(address){
b=document.querySelectorAll('button.medium.rounded.Button.hasText.Module.inviteEmailButton')[0]
i=document.querySelectorAll('input.emailInput')[0]
i.value = address
b.className = b.className.replace("disabled", "");
b.disabled = false;
e=document.createEvent('HTMLEvents');
e.initEvent('click',true,true);
b.dispatchEvent(e);
console.log(address);
}
function start_invite(){
var seconds = 3600/300; // hour limit 300
for (var count = 0; count < addresses.length; count++){
(function(){
var i = count;
setTimeout(function() {
invite(addresses[i]);
}, seconds*i*1000);
}());
}
}
@rkalkan
Copy link

rkalkan commented Jun 24, 2016

I could not work it, can you help me about it.
Im trying like this;

var seconds = 60/10; // hour limit 300
var move = 15;

// selectors
var sel_follow = 'Button FollowButton Module UserFollowButton btn gridItem hasText notNavigatable rounded:not(.dim)';

function click(sel, n){
e=document.createEvent('HTMLEvents');
e.initEvent('click',true,true);
bs=document.querySelectorAll(sel)[0].dispatchEvent(e);
console.log(n);
window.scroll(0,n*move);

setTimeout(function() { 
    click(sel, n+1); 
},  seconds*1000);

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment