This is a Slack slash command chatbot written in Python that takes an image URL and dogefies it using Cloud Functions, Cloud Pub/Sub, and Cloud Vision. All images are saved in Cloud Storage. This is not an official Google product.
For example, the app takes this image:
And returns this image:
To kick off the process, a user enter the /doge
command followed by the image URL they want to dogeify in a Slack channel.
The functionality of this app is broken down into two Cloud Functions.
Triggered by HTTP requests from the Slackbot.
Upon verifying the Slack equest, the function sends a message to Pub/Sub that contains the request data. The function returns a message back to the Slack channel in the meantime.
Triggered when a message is published to a specified Pub/Sub topic.
After doge-queue
publishes
its message to the Pub/Sub topic, doge-response
opens the message to get the image URL. The image is run through Cloud Vision
to get the labels associated with the image.
Pillow dogeifies the image using the labels as overlay text.
The image is uploaded to Cloud Storage and sent back to the Slack channel as a message.