Skip to content

Instantly share code, notes, and snippets.

@cowchimp
Created July 13, 2015 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cowchimp/f5ed55bc32846eb7836a to your computer and use it in GitHub Desktop.
Save cowchimp/f5ed55bc32846eb7836a to your computer and use it in GitHub Desktop.
Send you a daily email of the Packt Publishing free ebook of the day

Every day it fetches the 'free learning' page, scrapes the ebook title, and emails it to you.

If you find that book relevant, you still need to go to the page and and log in to save it your your account and download it.

[{"id":"4c3fd66f.b3c028","type":"http request","name":"","method":"GET","ret":"txt","url":"https://www.packtpub.com/packt/offers/free-learning","x":303,"y":115,"z":"4aa5a239.b55a5c","wires":[["794e3a7.f86b1c4"]]},{"id":"119bbf09.ee6441","type":"inject","name":"10:30am trigger","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"30 07 * * *","once":false,"x":152,"y":51,"z":"4aa5a239.b55a5c","wires":[["4c3fd66f.b3c028"]]},{"id":"794e3a7.f86b1c4","type":"html","name":"extract book title","tag":".dotd-title h2","ret":"text","as":"single","x":503,"y":82,"z":"4aa5a239.b55a5c","wires":[["3ee0ed18.c11f12"]]},{"id":"76356e7d.89ca9","type":"template","name":"template","field":"payload","template":"{{#payload}}\n{{.}}\n{{/payload}}\n\nhttps://www.packtpub.com/packt/offers/free-learning","x":856,"y":158,"z":"4aa5a239.b55a5c","wires":[["6491a713.9b6e58"]]},{"id":"6491a713.9b6e58","type":"e-mail","server":"smtp.mailgun.org","port":"587","name":"your@email.com","dname":"email","x":1039,"y":138,"z":"4aa5a239.b55a5c","wires":[]},{"id":"3ee0ed18.c11f12","type":"function","name":"trim & set subject","func":"msg.payload = msg.payload.map(function(item) {\n return item.trim();\n});\nmsg.topic = 'Free eBook from Packt Publishing';\nreturn msg;","outputs":1,"x":686,"y":127,"z":"4aa5a239.b55a5c","wires":[["76356e7d.89ca9"]]}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment