A silly simple Slack command handler which returns images from http://classicprogrammerpaintings.com/ which are relevant to the searched term
-
Register an account and an index named 'classicprogrammerpaintings' on https://www.algolia.com/. Save your app id and api key to the .env file
-
Register a Slack command and save the verification token (NOT the Oauth token!) to the .env file
-
Crawl http://classicprogrammerpaintings.com/ with the crawler in crawl-n-index, e.g. go run crawl-n-index/main.go - this will fetch the descriptions and image urls and save them in the 'classicprogrammerpaintings' index in Algolia
-
Run the webserver in the root folder. Configure the handler url in the Slack command in step 2. - you can either fire up a proper reverse proxy such as nginx in front of the go server or access it directly.
Use Localtunnel to pipe traffic from your dev machine
- if you call the slack command without parameters it returns a random image from the whole index