Google Poetry machine/toy/thingy

This started, as all things do with a couple of different influences.

The first was that I’d recently seen Brendan Dawes speak at TH;INC Beautiful Data (hosted by TechHub at Google Campus) in May, so was aware of his Happiness Machine (itself powered by We Feel Fine). To be honest, I was far more impressed by his  In Receipt Of The Now exhibition piece, mainly as it brought together different APIs to communicate a moment to the user.

So I knew I wanted to do link services together and I had just bought an Arduino Ethernet Shield (eBay via China, £6!).

First thing to do was access Twitter…
Cue a lot of Google Searches, I did find Labby’s @Arduino based twitter-enabled candy machine – all working and monitoring twitter but that was from November 2012 before the move to Twitter Auth 1.1.
Further searching uncovered this post on the Twitter Developers forum by @ArduinoDeurbel (Ralphs Deurbel).

Infact the hardest part was probably writing the PHP (yup, had to learn that too!)
Not content with just accessing my Twitter, I started looking at other calls to that API; Favourites, Timelines, etc.

The second part was a retweet by @greatdismal aka William Gibson

Screen Shot 2015-01-12 at 14.27.56

Wow! How cool is that?! Poetry from Google Searches!
@GooglePoetics are sometimes funny, often perversely dark but always haunting.

When I remembered the Happiness Machine a few days later, and I’ll be honest, I thought just printing them was almost too simple. However, I was looking for an excuse to expand my Arduino knowledge, so I bought a Thermal Printer from Cool Components and got to it, and finally I could use the LED buttons I had in my drawer!

Note: don’t overlook the power source, you can’t run it off the Arduino. Buy one, when you buy the printer, otherwise it’s a frustrating few days waiting for it to arrive. Doh.

Cue a lot of mistakes and wasted thermal paper!

Additionally, PHP peculiar to GooglePoetics tweets was required; mainly to remove any unwanted pre/post poem text, as well as rogue characters.
Next, was the matter of line breaks, relevant to the thermal printer. A tweet may be 140chars but a line of text is only 32chars. To prevent words being cut off, line breaks had to be added in PHP.


Eventually it worked the way I wanted, and barring no end of tinkering; Bold vs DoubleHeight text? How about an Icon (cue more Processing – this time from Adafruit )

So, I had this mess of wires on my table and an internal company meeting looming, so the night before I grabbed an empty box off a desk, papered it with Google Poetics quotes and stuffed the whole sorry mess inside and took the opportunity to run the Arduino off a 9V battery for the first time.


We presented, and I finished off the talk by introducing the Google Poetry Printer (bloody thing needs a name, dammit!) as, “a Digital Haiku generated by the most popular google searches, randomly selected and printed just for you”.


Next step is a finding a 3D Designer to create a file for the case that we can then get the box 3D Printed, and then a WiFi Shield (budget dependant).

3 thoughts on “Google Poetry machine/toy/thingy

Leave a Reply

Your email address will not be published. Required fields are marked *