Sha256: dee5969b7f2017725e7b42d92cee55ab03947e18840ec4e7d436a7af9656c226

Contents?: true

Size: 1.36 KB

Versions: 2

Compression:

Stored size: 1.36 KB

Contents

// List following and followers from several accounts

var users = ['sencha',
        'aconran',
        'adityabansod',
        'ambisinister',
        'arnebech',
        'ariyahidayat',
        'arthurakay',
        'bmoeskau',
        'darrellmeyer',
        'davidfoelber',
        'DavidKaneda',
        'donovanerba',
        'edspencer',
        'evantrimboli',
        'ExtAnimal',
        'jamieavins',
        'jarrednicholls',
        'jayrobinson',
        'lojjic',
        'luckymethod',
        'merrells',
        'mmullany',
        'philogb',
        'philstrong',
        'rdougan',
        'SubtleGradient',
        '__ted__',
        'tmaintz',
        'WesleyMoy',
        'whereisthysting'];

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.timeline-following').innerText;
            });
            console.log(user + ': ' + data);
        }
        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

2 entries across 2 versions & 1 rubygems

Version Path
phantomjs.rb-0.0.2 vendor/phantomjs-1.4.1_OSX/examples/follow.js
phantomjs.rb-0.0.1 vendor/phantomjs-1.4.1_OSX/examples/follow.js