mirror of
https://github.com/encounter/phantomjs.git
synced 2026-07-10 21:18:40 -07:00
tweets.js: Inevitable example of showing twitter status.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
Reference in New Issue
Block a user