- To see ease of implementing 3rd party Packages in Azure Functions
- Stateless way of getting notified using 3rd Party Services
- Proof to see how quick a function can be stood up
- Uses Azure Function Schedule Trigger (currently runs every minute using "0 */1 * * * * CRON)
- Uses RedditSharp to "scrape" Reddit subreddit (in this case /r/Azure)
- Gets Posts tht have been created within the last minute, digests them, and emails with SendGrid
-
Clone this Repo and restore :
git clone https://github.com/isaac2004/RedditPoller dotnet restore
-
Configure Azure Components
- Setup Free Azure Subscription (if you do not have one)
- Add new instance of SendGrid (Free Version) on your subscription
- You get 25k emails a month here
- Capture Api Key created during process and place in host.json "SendGridApiKey" setting
-
Publish App from Visual Studio 2017 Preview 3.0
- Right-Click RedditPoller project
- Create new Function App, Storage Account and Deploy
- Add SendGrid Api Key and email to be notified in App Settings of Azure Function
-
How can this be extended?
- Add custom logic to notify on specific posts (matching a keyword for instance)
- Add auth against Reddit (supported with RedditSharp) to get access to mailbox/subscribed subs/etc
- MakeTimerTrigger customizable
- Really options are plenty for adding hooks to Reddit
Copyright (c) 2016-2017 Isaac Levin
Twitter: @isaac2004