How it works

When you send the bot a snapchat - any snapchat - a picture of you're adorable dog, a big chocolate cake, a dolphin dancing. The bot is selfish and simply doesn't care about your life and what you send it.

Once you send your snap the bot will hit an API endpoint with JSON data on public art in the City of Edmonton. This RESTful API is provided by Namara, a service for browsing open data. The bot will then randomly select a piece of art from this JSON response.

It will do a google image search using the title and artist name of the particular piece. The Google Search API is used to handle this, and will return another JSON object this time holding a bunch of links to image results.

The bot is bold and trusts that the first image result is a picture of the piece of art. It will download that image. And that is it! At this point the SnapchatBot library is used to send this downloaded image back to the original (human) sender.

Due to Edmonton not having a ton of public art, there is only a handful of possible images that will be send back :)

Share this project: