Skip to content

Instantly share code, notes, and snippets.

@etachov
Last active August 29, 2015 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save etachov/4651e7ad89826a13ab07 to your computer and use it in GitHub Desktop.
Save etachov/4651e7ad89826a13ab07 to your computer and use it in GitHub Desktop.
Quick parse of Columbus Dispatch StoryMap data on Kasich fundraising trips
lat lon date date_formatted details
42.9956397 -71.4547891 March 24, 2015 2015-03-24 Manchester, N.H. Kasich gets a taste of New Hampshire folks' vetting of candidates
40.7127837 -74.0059413 March 25, 2015 2015-03-25 New York City Conservatives questions Kasich's support of Medicaid expansion in NYC
44.3106241 -69.7794897 March 25, 2015 2015-03-25 Augusta, Maine Faber travels to Maine to join Kasich
42.331427 -83.0457538 April 13, 2015 2015-04-13 Detroit, Mich. Gov. John Kasich 'seriously considering' running for president
34.8526176 -82.3940104 April 17, 2015 2015-04-17 Greenville, S.C. Kasich gets some pushback in South Carolina
42.7653662 -71.467566 April 18, 2015 2015-04-18 Nashua, N.H. Kasich shares message, makes friends on the road
38.9071923 -77.0368707 April 23, 2015 2015-04-23 Washington, D.C. Kasich, speaking in Washington, discusses potential presidential runSee the video
38.9071923 -77.0368707 May 1, 2015 2015-05-01 Washington, D.C. Kasich defends his directness
43.2081366 -71.5375718 May 6, 2015 2015-05-06 Concord, N.H. In New Hampshire, Gov. John Kasich portrays himself as a pragmatic conservative
32.715738 -117.1610838 May 13, 2015 2015-05-13 San Diego Gov. John Kasich seeking California cash for presidential bid
37.7749295 -122.4194155 May 14, 2015 2015-05-14 Private fundraising trip to San Franciso and Palo Alto.
34.0522342 -118.2436849 May 15, 2015 2015-05-15 Los Angeles Here's why John Kasich sees an opening in the presidential race
40.7127837 -74.0059413 May 20, 2015 2015-05-20 New York City Kasich meeting with billionaire hedge-fund manager in next week
33.7489954 -84.3879824 May 25, 2015 2015-05-25 Atlanta Critics of Medicaid expansion don't bother him, Kasich tells Georgia GOP
32.8323225 -79.8284258 May 27, 2015 2015-05-27 Mount Pleasant, S.C. 'I need your help' Kasich tells South Carolina voters
32.7766642 -96.7969879 May 29, 2015 2015-05-29 Dallas private fundraising trip
43.6422934 -72.2517569 June 4-5, 2015 2015-06-04 Lebanon, N.H. John Kasich wins some fans in New Hampshire
36.1699412 -115.1398296 June 11, 2015 2015-06-11 Las Vegas Kasich tries his odds in meeting with Las Vegas Republicans
40.7607793 -111.8910474 June 12, 2015 2015-06-12 Salt Lake City, Utah Kasich will attend GOP confab in Utah with Mitt Romney
35.0019259 -80.8565321 June 15, 2015 2015-06-15 Indian Land, S.C. Kasich's candor appreciated by few who show up to listen
42.5792027 -84.4435845 June 16, 2015 2015-06-16 Mason, Mich. Kasich, in Michigan, says presidential prospects look 'pretty darn good'
42.7647763 -71.4398074 June 17, 2015 2015-06-17 Hudson, N.H. John Kasich out talking to voters in New Hampshire
38.9071923 -77.0368707 June 19, 2015 2015-06-19 Washington, D.C. Gov. John Kasich talks of faith at conference
41.8781136 -87.6297982 June 22-23, 2015 2015-06-22 Chicago area private fundraising trip
41.6005448 -93.6091064 June 24, 2015 2015-06-24 Des Moines, Iowa Kasich tackles immigration issues during Iowa trip
38.9071923 -77.0368707 July 7, 2015 2015-07-07 Washington, D.C. Gov. John Kasich says it's too early to worry about GOP debates
32.216316 -80.752608 July 8, 2015 2015-07-08 Hilton Head, S.C. John Kasich talks foreign policy, urges tougher stance against ChinaMeanwhile, New Day for America, Kasich's campaign committee buys $1.5 million in air time for ads in New Hampshire.
36.1626638 -86.7816016 July 9, 2015 2015-07-09 Nashville, Tenn.Ohio Gov. John Kasich talks up Medicaid expansion
43.0717552 -70.7625532 July 12, 2015 2015-07-12 Portsmouth, N.H.John Kasich's New Hampshire TV ad gets favorable reviews from some in the state
43.2228599 -71.0470077 July 13, 2015 2015-07-13 Barrington, N.H.Kasich gets warm reception at New Hampshire town hall
library(jsonlite)
# Article: http://www.dispatch.com/content/topic/news/2015/07/kasich.html
# Original data here: https://gist.githubusercontent.com/skorasaurus/62b681866d1f2e39dcde/raw/3d3f94380de26024d990c2b93c6f2f8433b9cca7/kasich.json
# I manually removed the StoryMap metadata (i.e. everything outside the [ ]) in the interest of time
kasich_raw <- fromJSON("kasich.json")
# select the vectors needed and bind into a data frame
kasich_int <- data.frame(lat = kasich_raw$location$lat,
lon = kasich_raw$location$lon,
date = kasich_raw$text$headline,
date_formatted = as.Date(gsub("-[[:digit:]]|-[[:digit:]][[:digit:]]", "", kasich_raw$text$headline), format = "%B %d, %Y"),
# roughly remove all the html tags
# we lose the links but with more time you could do something a bit more subtle
details = gsub("<.*?>", "", kasich_raw$text$text)
)
# drop the introduction row
kasich_clean <- kasich_int[2:nrow(kasich_int),]
write.csv(kasich_clean, "kasich_trips.csv", row.names = F)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment