Sha256: c4e1b979e38f6e9e26056ae40f6e547fb19ab874c9b4161daf0d386552268bce

Contents?: true

Size: 954 Bytes

Versions: 17

Compression:

Stored size: 954 Bytes

Contents

// List following and followers from several accounts

var users = ['PhantomJS',
        'ariyahidayat',
        'detronizator',
        'KDABQt',
        'lfranchi',
        'jonleighton',
        '_jamesmgreene',
        'Vitalliumm'];

function follow(user, callback) {
    var page = require('webpage').create();
    page.open('http://mobile.twitter.com/' + user, function (status) {
        if (status === 'fail') {
            console.log(user + ': ?');
        } else {
            var data = page.evaluate(function () {
                return document.querySelector('div.profile td.stat.stat-last div.statnum').innerText;
            });
            console.log(user + ': ' + data);
        }
        page.close();
        callback.apply();
    });
}

function process() {
    if (users.length > 0) {
        var user = users[0];
        users.splice(0, 1);
        follow(user, process);
    } else {
        phantom.exit();
    }
}

process();

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
hooch-0.4.2 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/follow.js
hooch-0.4.1 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/follow.js
hooch-0.4.0 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/follow.js
hooch-0.3.0 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/follow.js
hooch-0.2.1 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/follow.js
hooch-0.2.0 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/follow.js
hooch-0.1.0 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/follow.js
hooch-0.0.8 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/follow.js
hooch-0.0.7 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/follow.js
hooch-0.0.6 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/follow.js
entangled-0.0.16 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/follow.js
entangled-0.0.15 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/follow.js
entangled-0.0.14 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/follow.js
entangled-0.0.13 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/follow.js
entangled-0.0.12 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/follow.js
entangled-0.0.11 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/follow.js
entangled-0.0.10 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/follow.js