Skip to content

Instantly share code, notes, and snippets.

@lvnilesh
Last active December 14, 2015 19:58
Show Gist options
  • Save lvnilesh/5140047 to your computer and use it in GitHub Desktop.
Save lvnilesh/5140047 to your computer and use it in GitHub Desktop.
#!/bin/sh
curl http://phantomjs.googlecode.com/files/phantomjs-1.6.1-linux-x86_64-dynamic.tar.bz2 | bunzip2 -c | tar x
mv phantomjs-1.6.1-linux-x86_64-dynamic phantomjs
cat > foo.js <<EOF
var page = require('webpage').create();
url = 'http://vt.londhe.com';
page.open(url, function (status) {
console.log("XXX", status);
});
window.setTimeout(function () {
phantom.exit();
}, 300*1000);
EOF
while true ; do ./phantomjs/bin/phantomjs foo.js & sleep 1 ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment