From d8a5c2b7d0167d64ed74c8db1dfbf315806ea009 Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Sun, 26 Dec 2010 23:46:50 -0800 Subject: [PATCH] tweets.js: Inevitable example of showing twitter status. --- examples/tweets.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 examples/tweets.js 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(); +}