Working in the IT industry can be very exiting. But not always. There is quite some communication involved when working in a team, and some of those meetings are filled with dull moments to get through, and I must admit that it is sometimes quite challenging to stay sharp and focused. Buzzword bingo may help you to stay sharp.
I recently got inspired by a colleague who wrote buzzword-bingo in PHP. Buzzword-bingo? It’s plain-old bingo, but there are words instead of numbers on the bingo-card. Each time a word from your bingo-card is spoken during the meeting, tick it off. When all of the words from your card were used, yell “Bingo!”. But that last part is purely optional in my opinion. I don’t intend to disrespect the speaker in any way, I just want to stay focused!
In Unix, nearly everything can be addressed as if it were a file on disk. That also applies to websites! So instead of opening a file to read, you can instruct it to read a website as if it were a client. Reading information from a website is somewhat different from a plain file, as websites require clients to speak valid HTTP. A little sniffing with wireshark and wget will show that fopen doesn’t use any HTTP-header by itself, which causes some webservers to fail to respond. Fortunately, fopen supports additional parameters that can be used to establish a valid HTTP connection. In this particular case a bare minimum: a wildcard accept-header, a fake useragent string, containing the name of the originating website and the client-ip address, and a host-header containing the name of the website it is visiting.
Reading information from the website is done with fgetss, which strips any HTML (or PHP) and produces plain text; just what’s needed for buzzword-bingo! http_get.php loads that into a buffer and strips out the first 6 words per line.
I’ve done quite a bit of programming over the years, and Buzzword Bingo is certainly not code that I’m particularly proud of. I hacked this up within a day, and later added the server component to it. Bingo.html is riddled with bugs, which you’ll find soon enough if you play around with card dimensions and wordlists. But it works for normal situations where you have a large enough wordlist and reasonably normal card. But feel free to improve it. If you do, please share the result!
Please note that the (fake) useragent-header used to access pastebin.ca contains both the name of the website and ip-address of the client playing bingo. I did that to be able to trace abuse (to pastebin.ca), although that part of the program can easily be altered.
But really, Buzzword Bingo is great fun to stay sharp, listen actively and respond to others. Bring a little humor to a meeting. You can play it just by yourself or with others. See how others respond to a game while discussing work… Hah! I should try that some day 😉