diff --git a/examples/tweets.js b/examples/tweets.js new file mode 100644 index 00000000..dd6a6c74 --- /dev/null +++ b/examples/tweets.js @@ -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(); +}