Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function _x(STR_XPATH) {
- var xresult = document.evaluate(STR_XPATH, document, null, XPathResult.ANY_TYPE, null);
- var xnodes = [];
- var xres;
- while (xres = xresult.iterateNext()) {
- xnodes.push(xres);
- }
- return xnodes;
- }
- $(_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>');
- function AutoFollow() {
- __cnt__ = 0;
- jQuery('.stream button.follow-button > span.follow-text').each(function (i, ele) {
- ele = jQuery(ele);
- if (ele.css('display') != 'block') {
- console.log('already following:', i);
- return;
- }
- setTimeout(function () {
- ele.click();
- following++;
- }, __cnt__++ * 500);
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement