technews.js: Snap Google News Sci/Tech as image.

1.0
Ariya Hidayat 2010-12-31 19:35:38 -08:00
parent c5de293368
commit a2bec750cd
1 changed files with 14 additions and 0 deletions

14
examples/technews.js Normal file
View File

@ -0,0 +1,14 @@
if (phantom.storage.length === 0) {
var address = phantom.arguments[0];
phantom.storage = 'news';
phantom.viewportSize = { width: 320, height: 480 };
phantom.open('http://news.google.com/news/i/section?&topic=t');
} else {
var body = document.body;
body.style.backgroundColor = '#fff';
body.querySelector('div#title-block').style.display = 'none';
body.querySelector('form#edition-picker-form').parentElement.parentElement.style.display = 'none';
phantom.sleep(500);
phantom.render('technews.png');
phantom.exit();
}