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
-
countonlybluecars likes this
-
thenoldtestament reblogged this from newsweek
-
topicnews reblogged this from newsweek
-
topicnews likes this
-
4thecrazy1s likes this
-
kepete reblogged this from merici
-
greglinch likes this
-
merici reblogged this from newsbeastlabs
-
m-x likes this
-
rotated8 reblogged this from newsbeastlabs
-
peaceloveecstasyunityrespect likes this
-
husky04 reblogged this from newsweek
-
mynameislinda likes this
-
liquidfunk likes this
-
samosass reblogged this from newsweek
-
litgrl14 likes this
-
ashotofhelena likes this
-
f-l-o-i-p-o-i-d reblogged this from newsweek
-
wahlergebnisse reblogged this from newsweek
-
weusedtorun likes this
-
ecampusdotcom likes this
-
steampoweredmedia likes this
-
tijuana79 likes this
-
supertreble reblogged this from newsweek
-
supertreble likes this
-
dubliner reblogged this from newsweek
-
sommanita reblogged this from newsweek
-
gonzni likes this
-
lord-kitschener likes this
-
sarahstocracy reblogged this from newsweek
-
talkdatatome reblogged this from newsbeastlabs
-
nohourisevereternity reblogged this from newsweek
-
thedivineasshole likes this
-
janetmason23 likes this
-
wanderin-der-welt likes this
-
newsweek reblogged this from newsbeastlabs and added:
newest Tumblr: NewsBeast Labs! As...description, we’ll be giving
-
cheatsheet likes this
-
newsbeastlabs posted this