Newsletter Example


Cat Of The Day

This sketch sends you a daily email of 9 of the top cats from the last 24 hours on imgur.

It does so by using the Cron integration, set to fire daily at 8:00. When triggered, it fetches the HTML from the page and finds the images using the .image-list-link jQuery-style selector. It then iterates over the results using a regex to extract the image source and puts that within a 3x3 <table>.

Using the persisted storage block it would be possible to store a unique ID (e.g. the URL) to ensure that the email always contains new cat pictures in the very unlikely event there's not a sufficient number of new ones that day.