Skip to content

Instantly share code, notes, and snippets.



Last active Nov 3, 2015
What would you like to do?
You would have to use this with a cronjob or something of the sort
var casper = require('casper').create({viewportSize: {width: 960, height: 600}});
var fs = require('fs');
casper.start('', function() {
var now = this.fetchText('#hnmain');
var old ='old.txt');
if (old !== now) {'', {
method: 'post',
data: {'text1': old, 'text2': now}
}).then(function () {
casper.captureSelector('diff' + + '.png', '#top');
// Code to notify you here, e.g. IFTTT API, mail, etc
fs.write('old.txt', now, 'w');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.