Skip to content

Instantly share code, notes, and snippets.

@jeka-kiselyov
Created April 28, 2014 17:17

Revisions

  1. jeka-kiselyov created this gist Apr 28, 2014.
    31 changes: 31 additions & 0 deletions vklike.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    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);