Skip to content

Instantly share code, notes, and snippets.

@jeka-kiselyov
Created April 28, 2014 17:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeka-kiselyov/11378288 to your computer and use it in GitHub Desktop.
Save jeka-kiselyov/11378288 to your computer and use it in GitHub Desktop.
Do like avatars of every vk user on search page
var l = document.getElementsByClassName('img'); for (var k in l) if (typeof(l[k].onmouseover) == 'function') l[k].onmouseover();
var els = document.getElementsByClassName('search_bigph');
var cur_els = 0;
setTimeout(next_cur_el, 5000);
function next_cur_el()
{
if (typeof(els[cur_els]) == 'undefined') return;
els[cur_els].click();
var r1 = Math.random() * (3000 - 500) + 500;
var r2 = Math.random() * (5000 - 2000) + 2000 + r1;
setTimeout(next_do_like, r1);
cur_els++;
console.log('Item: '+cur_els);
setTimeout(next_cur_el, r2);
}
function next_do_like()
{
var cs = window.getComputedStyle(document.getElementById('pv_like_icon'), null);
if (typeof(cs.opacity) != 'undefined' && cs.opacity == '1')
{
console.log('Already');
Photoview.hide(0);
return;
}
Photoview.like();
Photoview.hide(0);
console.log('Clicked');
}
console.log('Total on page: '+els.length);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment