Created
August 26, 2015 04:21
-
-
Save fbrnc/2d511848e168fb6ecdf4 to your computer and use it in GitHub Desktop.
Send a daily email with a screenshot of the current USD/EUR conversion rate attached to it.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var page = require('webpage').create(); | |
page.viewportSize = { "width": 1024, "height": 1500 }; | |
page.clipRect = { "top": 530, "left": 20, "width": 650, "height": 541 }; | |
page.open('http://www.xe.com/currencycharts/?from=USD&to=EUR&view=1M', function() { | |
setTimeout(function() { | |
page.evaluate(function() { | |
document.body.bgColor = 'white'; | |
}); | |
page.render('xe.png'); | |
phantom.exit(); | |
}, 5000); | |
}); | |
// crontab -e: | |
// 0 7 * * 1-5 phantomjs xe.js ; cat xe.png | uuencode xe.png | mail -s "XE" mail@example.com |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment