This Reddit slack bot uses the Linklater API to return a trending Reddit story (using this Reddit API) related to programming, and whatever query you pass. So, /reddit javascript would return a hot JS story from Reddit (including its link, score, and more), and /reddit tennis would return a trending story about tennis from the programming section.
To run, clone the repo, stack build, stack exec redditbot, and then open up a Ngrok tunnel. You'll need a Slack incoming webhook, too.
Slack steps:
- After going to your apps in the top righthand corner of https://api.slack.com, and selecting the bot you want (or creating a new one),select incoming webhooks to generate your web hook. Put this in a file called hook.
- Right below that, you should this on the left-hand side.
Select slash commands underneath features.
You should end up with something like this:
Try it out for yourself!