Advertisement
OmgImAlexis

Twitter Auto Follower

Apr 13th, 2014
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. function _x(STR_XPATH) {
  2. var xresult = document.evaluate(STR_XPATH, document, null, XPathResult.ANY_TYPE, null);
  3. var xnodes = [];
  4. var xres;
  5. while (xres = xresult.iterateNext()) {
  6. xnodes.push(xres);
  7. }
  8.  
  9. return xnodes;
  10. }
  11. $(_x('//*[@id="timeline"]/div[1]/div[2]/div/div/div')).append('<button onclick="AutoFollow()" class="btn" type="button"><span class="button-text">Follow all</span></button>');
  12.  
  13. function AutoFollow() {
  14. __cnt__ = 0;
  15. jQuery('.stream button.follow-button > span.follow-text').each(function (i, ele) {
  16. ele = jQuery(ele);
  17. if (ele.css('display') != 'block') {
  18. console.log('already following:', i);
  19. return;
  20. }
  21. setTimeout(function () {
  22. ele.click();
  23. following++;
  24. }, __cnt__++ * 500);
  25. });
  26. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement