Curatorial Poetry

Curatorial Poetry

I made a fun thing…yesterday. In my 20% time, downtime, er.. 2am time, I decided to build a simple tumblr blog called Curatorial Poetry. I was inspired by Aaron’s take on our collection data and how he chose to present objects in our collection that have no image, but have a “description.” In the office we often have fun reading these aloud, or better, with Apple’s screen reader.

But, I thought it would be fun to “reblog” these in another form. So, I built a simple python script to do just that. To do this, I forked our collection data and wrote a short tool to convert our JSON objects into an sqlite3 database. I chose sqlite3 because, well, it’s light, and doesn’t require me to set up a DB server or anything.

Next, I spent most of my time trying to learn how oAuth2 works. It took me a good bit of time googling around before I realized that the python-oath2 library includes oAuth1 ( which tumblr uses ). All I really needed to do with the tumblr API was to create the post. Once I had my keys worked out and authenticating, it was just one line of code.

Once the post is published, the script updates my sqlite3 db so it makes sure to not post the same thing twice. Thats all!

I’d like to expand the code for this a bit to add some error checking, build in connections to our own API ( instead of using the data dump ) and connect with Twitter. I’m also interested in adding other museum’s data. We have the IMA data available on GitHub, but they don’t include “description” text, so well see… In the meantime, follow it and you’ll receive a new “poem” in your tumblr feed every two hours, for the next 8 years!

  • Pingback: visualize poetry – 2 « Sue Boynton Poetry Contest()

  • Jeff_Thompson

    A super clean and useful example – thanks! I’ve been hacking away at a similar program using Python, but I can’t figure out how to get the oauth_token and oauth_secret from Tumblr. Could you post some details on how that process works? Thanks!

    • http://micahwalter.com Micah Walter

      Jeff,

      You first need to register your application with Tumblr via this link http://www.tumblr.com/docs/en/api/v2. This will get you a Consumer Key and Consumer Secret.

      Then, you run this Python script https://gist.github.com/micahwalter/4544942 and follow the steps. It will result in a URL which you paste into your browser, this causes the API to produce a Request Token and Secret.

      In the script you’ll see it just stores these values in memory and uses them to do a couple API calls at the end of the script, but you can save these values and use them in a command line app like the one I made for Curatorial Poetry permanently ( or at least until Tumblr invalidates them ). I hope this helps.

      Micah

      • Jeff_Thompson

        Thanks Micah, I tried your Gist and several otherw to get the OAuth token/secret with no luck. I ended up installing the Tumblr Ruby Client:

        http://mwunsch.tumblr.com/post/441371943/tumblr-rb

        Super easy! Also worth mentioning that Tumblr also just released a Python API this week:

        https://github.com/tumblr/pytumblr

        • http://micahwalter.com Micah Walter

          ah very cool on the python tip… not sure what you might have been doing wrong, though I recall i had to look through the URL to find the key you need to use as the “pin”

  • Pingback: Curatorial Poetry | The Jenks Society for Lost Museums()