It came about through a continuing appreciation of how cool Linux really is; how useful it is in our work; and further, the unintentional, but rather ridiculous ‘gender specification‘ that occurs when one looks up a function within the Linux environment: $man <command name> A specification that creates a curious and often humorous juxtaposition:
— Manpage du Jour (@manpagedujour) May 5, 2015
— Manpage du Jour (@manpagedujour) July 15, 2015
— Manpage du Jour (@manpagedujour) April 19, 2015
— Manpage du Jour (@manpagedujour) May 2, 2015
It is therefore a conscious attempt at subverting the concept of gender role, but notably, it is also a conscious, and serious attempt to introduce all users to the simplicity and accessibility of the Linux environment.
The concept of this bot is simple, to tweet a single* command daily. Alongside the command is a link to a manual page; approximating the act of typing the command into a Linux terminal and subtly hinting to users to experiment by doing the same for themselves.
Attempts were made to find methods of accessing the manual in different ways, e.g. emulation, but in the end a suitable and minimalist web resource was selected in http://man7.org/linux/man-pages/.
The index was scraped and reorganized into a comma separated values (CSV) spreadsheet that could be used as a source for randomized tweets. While this could be done automatically via script, I elected to do this by hand for this first attempt. If I update the source in a few months, or a few years, then I will consider a scripted mechanism.
From there it was a matter of taking my code already utilizing the Python sixohsix twitter API libraries and enabling it to tweet from a new account. The primary function sits here: https://github.com/exponential-decay/manpage-du-jour/blob/master/manpage-du-jour.py#L55 it’s a little simplistic, and could easily be improved to make better use of constants and to improve clarity.
The function needs to grab the command name, the command description, and the relative path from the CSV and generate an absolute reference. URLs are always shortened to 22 characters in a tweet and so the code also has to honor that and a 140 character limit when formatting, before submitting to the server:
And it’s done. A twitter bot, a learning resource, a source of humor, and a source of gender subversion; an entity that should still be around when twitter itself becomes post-apocalyptic. Roaming in a vast desert of spam bots, education bots, random bots, and all manners of grey-goo.
There isn’t a lot more to discuss in the detail but I’m open to receive questions about the code. This blog entry is as much about promotion for this resource; your sharing of it with colleagues and friends interested in programming, Linux, computing history, or just computing in general is appreciated. Thank you in advance for following.
Source code and more information can be found on GitHub: https://github.com/exponential-decay/manpage-du-jour