Last change
on this file since 31525 was 31525, checked in by ak19, 7 years ago |
Nathan provided more stuff: Themes folder contains Sencha's Themebuilder which generates GXT Themes. It includes the .theme and generated .jar files for the project theme.
|
File size:
954 bytes
|
Rev | Line | |
---|
[31525] | 1 | // List following and followers from several accounts
|
---|
| 2 |
|
---|
| 3 | var users = ['PhantomJS',
|
---|
| 4 | 'ariyahidayat',
|
---|
| 5 | 'detronizator',
|
---|
| 6 | 'KDABQt',
|
---|
| 7 | 'lfranchi',
|
---|
| 8 | 'jonleighton',
|
---|
| 9 | '_jamesmgreene',
|
---|
| 10 | 'Vitalliumm'];
|
---|
| 11 |
|
---|
| 12 | function follow(user, callback) {
|
---|
| 13 | var page = require('webpage').create();
|
---|
| 14 | page.open('http://mobile.twitter.com/' + user, function (status) {
|
---|
| 15 | if (status === 'fail') {
|
---|
| 16 | console.log(user + ': ?');
|
---|
| 17 | } else {
|
---|
| 18 | var data = page.evaluate(function () {
|
---|
| 19 | return document.querySelector('div.profile td.stat.stat-last div.statnum').innerText;
|
---|
| 20 | });
|
---|
| 21 | console.log(user + ': ' + data);
|
---|
| 22 | }
|
---|
| 23 | page.close();
|
---|
| 24 | callback.apply();
|
---|
| 25 | });
|
---|
| 26 | }
|
---|
| 27 |
|
---|
| 28 | function process() {
|
---|
| 29 | if (users.length > 0) {
|
---|
| 30 | var user = users[0];
|
---|
| 31 | users.splice(0, 1);
|
---|
| 32 | follow(user, process);
|
---|
| 33 | } else {
|
---|
| 34 | phantom.exit();
|
---|
| 35 | }
|
---|
| 36 | }
|
---|
| 37 |
|
---|
| 38 | process();
|
---|
Note:
See
TracBrowser
for help on using the repository browser.