When I was teaching a class on data visualization and we started tackling making visualizations using data from the NYT API, I created a simple bar chart visualization using Processing, using code I adapted from an exercise by Jer Thorpe in the book Beautiful Visualization. I thought, “Who are two newsworthy figures that will have lots of mentions?” And I chose Bill and Hillary Clinton, in the time period 2011-2012.

Completely blew my mind that Bill Clinton appears to have gotten more NYT mentions during that time, considering that she was Secretary of State and he was not even in office at the time. Note: This example, as you’ll see below, does not use the NYT’s faceted search, which identifies individuals more accurately than fulltext article search. So this mention count might just be plain wrong. But as soon as I ran it I knew it had to be a “Texts from Hillary” meme.

texts_from_hillary_with_NYT_API

Here’s the code I used to produce this. In order to make it work, you’ll need to get your own NYT API key, which you can get here. It’s written in Processing.

Now, you can’t just cut and paste the code above into the Processing IDE and expect it to work. You need three more ingredients:

  1. An NYT Article Search API key. Get one here.
  2. The NYT API library for processing. Download that here, and read the instructions here on how to add a library to a Processing sketch here.
  3. A background “Texts from Hillary” image that’s the same size as the canvas. I got mine here.
Category : Uncategorized

2 thoughts on “Texts from Hillary Meme using real New York Times Data

  1. Ha! That’s Hillary-ous! 😀

Leave a Reply

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