tweets.js: Inevitable example of showing twitter status.

1.0
Ariya Hidayat 2010-12-26 23:46:50 -08:00
parent 9d7e4b4156
commit d8a5c2b7d0
1 changed files with 12 additions and 0 deletions

12
examples/tweets.js Normal file
View File

@ -0,0 +1,12 @@
// Get twitter status from someone
if (phantom.storage.length === 0) {
phantom.storage = 'tweets';
phantom.open('http://mobile.twitter.com/mr3bc');
} else {
var list = document.querySelectorAll('span.status');
for (var i = 0; i < list.length; ++i) {
phantom.log((i + 1) + ': ' + list[i].innerHTML.replace(/<.*?>/g, ''));
}
phantom.exit();
}