Tracking the presidential groundgame
As the two presidential campaigns launch into their final throws, we wanted to see who had the biggest footprint of campaign headquarters across the country. The map above ran with the resulting story showing Obama with a large advantage, especially in swing states. We thought getting from idea to map / chart would be as easy as checking the candidates’ websites or calling their press offices to request a full list. Not quite.
Finding Romney’s offices
Governor Romney’s campaign didn’t get back to our requests so we dug into their website. Romney only had volunteer offices in 16 states, each of which has a web page and a map showing office locations. Here’s Ohio’s. The data that powers the map is visible if you look at the Javascript files that power it, so we copied the data sixteen states into one file and saved it. They were in JSON file format — but more on that later.
Finding Obamas’s offices
President Obama has offices in many more states than Romney so going state by state is more of a hassle and his campaign’s website doesn’t have the same convenient state-by-state maps. Instead, you input your zip code and it gives you a map of all locations within forty miles of you. 
Needless to say, getting a comprehensive list by canvassing the country in 40 mile chunks was out of the question. Digging again into the javascript that powers the website (aside: the Obama website has some slick ASCII art in their source code), their volunteer center finder works by sending out a query that looks like this http://offices.barackobama.com/postal_code/10011/ with your zip code making up the those last five digits. If you put that in your browser and hit return you’ll see the centers closest to the Daily Beast offices in Manhattan.
It automatically looks within 40 miles of you but if you add “?distance=1000” at that url, it will search within however many miles you want. 
So if you add the zip code for the rough geographic center of the US, Lebanon, Kansas and a distance of 10,000 miles you get something that looks like this:
http://offices.barackobama.com/postal_code/66952?distance=10000
which will give you a list, in JSON again, of every volunteer center in the country.
This list returns a lot of information we didn’t immediately need, though, like hours of operation and email address contacts. We wrote an R script that took just the fields the we needed for our map, mostly the latitude and longitude, city, and state and made a clean spreadsheet in CSV format.
From there we were able to do counts by state and plot them on a map. Once we had the final count, the Obama campaign confirmed that our number was in the right ballpark.
BONUS: Obama’s offices all include a Foursquare ID. If you want to play around with them, here’s the data, right click and choose “Save Links As…” if it doesn’t download automatically. Some interesting things could be finding the mayors of the obama campaign offices, which location has the most check-ins, check-ins over time in different locations etc. — let us know at newsbeastlabs@gmail.com and we’ll put up your stuff.
Here’s a spreadsheet of both candidates’ headquarters, as well.
-michael

Tracking the presidential groundgame

As the two presidential campaigns launch into their final throws, we wanted to see who had the biggest footprint of campaign headquarters across the country. The map above ran with the resulting story showing Obama with a large advantage, especially in swing states. We thought getting from idea to map / chart would be as easy as checking the candidates’ websites or calling their press offices to request a full list. Not quite.

Finding Romney’s offices

Governor Romney’s campaign didn’t get back to our requests so we dug into their website. Romney only had volunteer offices in 16 states, each of which has a web page and a map showing office locations. Here’s Ohio’s. The data that powers the map is visible if you look at the Javascript files that power it, so we copied the data sixteen states into one file and saved it. They were in JSON file format — but more on that later.

Finding Obamas’s offices

President Obama has offices in many more states than Romney so going state by state is more of a hassle and his campaign’s website doesn’t have the same convenient state-by-state maps. Instead, you input your zip code and it gives you a map of all locations within forty miles of you. 

Needless to say, getting a comprehensive list by canvassing the country in 40 mile chunks was out of the question. Digging again into the javascript that powers the website (aside: the Obama website has some slick ASCII art in their source code), their volunteer center finder works by sending out a query that looks like this http://offices.barackobama.com/postal_code/10011/ with your zip code making up the those last five digits. If you put that in your browser and hit return you’ll see the centers closest to the Daily Beast offices in Manhattan.

It automatically looks within 40 miles of you but if you add “?distance=1000” at that url, it will search within however many miles you want. 

So if you add the zip code for the rough geographic center of the US, Lebanon, Kansas and a distance of 10,000 miles you get something that looks like this:

http://offices.barackobama.com/postal_code/66952?distance=10000

which will give you a list, in JSON again, of every volunteer center in the country.

This list returns a lot of information we didn’t immediately need, though, like hours of operation and email address contacts. We wrote an R script that took just the fields the we needed for our map, mostly the latitude and longitude, city, and state and made a clean spreadsheet in CSV format.

From there we were able to do counts by state and plot them on a map. Once we had the final count, the Obama campaign confirmed that our number was in the right ballpark.

BONUS: Obama’s offices all include a Foursquare ID. If you want to play around with them, here’s the data, right click and choose “Save Links As…” if it doesn’t download automatically. Some interesting things could be finding the mayors of the obama campaign offices, which location has the most check-ins, check-ins over time in different locations etc. — let us know at newsbeastlabs@gmail.com and we’ll put up your stuff.

Here’s a spreadsheet of both candidates’ headquarters, as well.

-michael

  1. mhkeller reblogged this from newsbeastlabs
  2. thenoldtestament reblogged this from newsweek
  3. topicnews reblogged this from newsweek
  4. katyetc reblogged this from merici
  5. merici reblogged this from newsbeastlabs
  6. rotated8 reblogged this from newsbeastlabs
  7. husky04 reblogged this from newsweek
  8. samosass reblogged this from newsweek
  9. floipenstein reblogged this from newsweek
  10. wahlergebnisse reblogged this from newsweek
  11. ssnowwhitee reblogged this from newsweek
  12. dubliner reblogged this from newsweek
  13. sommanita reblogged this from newsweek
  14. talkdatatome reblogged this from newsbeastlabs
  15. wahooamidstthecornfields reblogged this from newsweek
  16. newsweek reblogged this from newsbeastlabs and added:
    newest Tumblr: NewsBeast Labs! As...description, we’ll be giving
  17. newsbeastlabs posted this
Notes and images from an ever-growing digital newsroom.

Newsweek & The Daily Beast

Contributors:
Brian Ries & Sam Schlinkert

Formerly:
Michael Keller, Andrew Sprouse, Lynn Maharas, & Clarisa Diaz

view archive