Making a Slack Printer for Fun
I have been rather bored lately due the repetitive nature of things around me. To get rid of my boredom, I turned to Iron Man 3 for advice.
Slide to 1:33 - "why don't you just build something?"
I looked around me for boring and uninspiring things I could fix in a fun way. I found one - my very high number of unread messages in Slack.
While Slack is an excellent communication software, it does lack personality as a platform - unless you are into emojis. It is just another boring messaging software that require users to sit behind a keyboard or touch screen (phone) to interact. It is boring.
Let's turn this boring messenger into something cooler. I tried it already with my 'Slack Shoes'. The most unconventional and fun way to fix Slack's boredom issue is actually inspired by Short Stories' brilliant story dispensers.
Slack notifications should be:
- more tactile
- be easy to read
- be disposable and "take-away"
Essentially, Slack messages to channels (that I were important to me) had to be printed in a successive flow and in a disposable way.
Requirements
- Thermal Printer
- Thermal Paper
- Slack Bot and Events feature access in the workspace
- A Raspberry Pi for handling actuation *pi zero would work too for this concept
- A Server for the event parsing and triggering
The Concept
In order to maximise the use of the printer, I decoupled the event/message parsing from the actuation. In the future, other software could use the printer.
How does it work?
Users send messages via Slack.
Slack POST messages via to the 1st server (running Flask). In this case, I have used an always-on container (Ubuntu 18 + Flask) on Codeanywhere (my favourite IDE these days). it has been ngroked (custom domain assigned to the server).
The slackevents library is used to listen to events in the python bot script. The domain is configured in Slack's Events.
Messages received from selected channels are sent to the Raspberry Pi (GET method - I should have used POST but for the ease of network debugging, opted for GET). The pi has its domain mapped via Dataplicity.
The PI runs Flask (auto runs /etc/rc.local )and receives requests from the Condeanywhere container. The Pi also has the ESC/POS libraries installed to interact with the printer which was connected via USB. A quick lsusb in the terminal reveals the printer's device information.
Upon receiving the message from the container, the Pi signals the printer to print it.
Issues faced while making this Slack Printer
- Ngrok's free package is a no-go. I had to go for the basic package for the custom fixed domain.
- The printer was bulkier than I planned.
The Final Output
Since it's April and everybody is looking forward to Easter, I themed the output around Easter - got some fake grass, some eggs, and a case from Hobbycraft. The wooden case was smaller than the printer, hence the reason for it to be sideways.
Slacking and Printing!!!!
Code:
Now, this is fun! My desk is now cooler and ready for Easter! Future improvements - switch method to POST (from 1st server to Pi), feature basic key authentication to avoid misuse, and adding Jira support. It would be great to print Jira tickets for scrum updates (using an old school physical board).
When bored, build something! Woo!
SaaS Engineer | Product Developer | Maker
5 年The Sequel -?Making the Slack Printer more versatile through a Chrome Extension - https://www.dhirubhai.net/pulse/making-slack-printer-more-versatile-through-chrome-shah-auckburaully
Working on the next project.
5 年This is quality, where do we buy one?
Global Marketing Procurement at TikTok
5 年Great read Shah!