2011-03-12 21:45:56 +03:00
|
|
|
# List following and followers from several accounts
|
|
|
|
|
2012-12-06 16:43:59 +04:00
|
|
|
users = [
|
2011-05-27 14:09:15 +04:00
|
|
|
'ariyahidayat'
|
2012-03-05 09:49:26 +04:00
|
|
|
'detronizator'
|
|
|
|
'KDABQt'
|
|
|
|
'lfranchi'
|
|
|
|
'jonleighton'
|
2012-12-06 16:43:59 +04:00
|
|
|
'_jamesgreene'
|
2011-05-27 14:09:15 +04:00
|
|
|
]
|
|
|
|
|
|
|
|
follow = (user, callback) ->
|
2011-09-13 00:17:54 +04:00
|
|
|
page = require('webpage').create()
|
2011-05-27 14:09:15 +04:00
|
|
|
page.open 'http://mobile.twitter.com/' + user, (status) ->
|
|
|
|
if status is 'fail'
|
|
|
|
console.log user + ': ?'
|
2011-03-12 21:45:56 +03:00
|
|
|
else
|
2012-06-21 09:53:14 +04:00
|
|
|
data = page.evaluate -> document.querySelector('div.profile td.stat.stat-last div.statnum').innerText;
|
2011-05-27 14:09:15 +04:00
|
|
|
console.log user + ': ' + data
|
2012-12-06 16:43:59 +04:00
|
|
|
page.close()
|
2011-05-27 14:09:15 +04:00
|
|
|
callback.apply()
|
|
|
|
|
|
|
|
process = () ->
|
|
|
|
if (users.length > 0)
|
|
|
|
user = users[0]
|
|
|
|
users.splice(0, 1)
|
|
|
|
follow(user, process)
|
|
|
|
else
|
|
|
|
phantom.exit()
|
|
|
|
|
|
|
|
process()
|