mirror of https://github.com/vitalif/phantomjs
tweets.js: Inevitable example of showing twitter status.
parent
9d7e4b4156
commit
d8a5c2b7d0
|
@ -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();
|
||||
}
|
Loading…
Reference in New Issue