Bug:Fix file validation issue
[vnfsdk/refrepo.git] / vnfmarket / src / main / webapp / vnfmarket / node_modules / phantomjs / lib / phantom / examples / follow.coffee
1 # List following and followers from several accounts
2
3 users = [
4   'PhantomJS'
5   'ariyahidayat'
6   'detronizator'
7   'KDABQt'
8   'lfranchi'
9   'jonleighton'
10   '_jamesmgreene'
11   'Vitalliumm'
12   ]
13
14 follow = (user, callback) ->
15   page = require('webpage').create()
16   page.open 'http://mobile.twitter.com/' + user, (status) ->
17     if status is 'fail'
18       console.log user + ': ?'
19     else
20       data = page.evaluate -> document.querySelector('div.profile td.stat.stat-last div.statnum').innerText;
21       console.log user + ': ' + data
22     page.close()
23     callback.apply()
24
25 process = () ->
26   if (users.length > 0)
27     user = users[0]
28     users.splice(0, 1)
29     follow(user, process)
30   else
31     phantom.exit()
32
33 process()