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.
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: