Created
April 28, 2014 17:17
Do like avatars of every vk user on search page
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 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