Skip to content

Instantly share code, notes, and snippets.

@drewconway
Created February 9, 2011 04:22
Show Gist options
  • Save drewconway/817875 to your computer and use it in GitHub Desktop.
Save drewconway/817875 to your computer and use it in GitHub Desktop.
Function returns quater scores from Wikipedia Super Bown pages
# Function returns quater scores from Wikipedia Super Bown pages
get.scores<-function(numeral) {
# Base URL for Wikipedia
wp.url<-getURL(paste("http://en.wikipedia.org/wiki/Super_Bowl_",numeral,sep=""))
wp.data<-htmlTreeParse(wp.url, useInternalNodes=TRUE)
score.html<-getNodeSet(wp.data,"//table[@style='background-color:transparent;']")
score.table<-readHTMLTable(score.html[[1]])
score.table<-transform(score.table, SB=numeral)
return(score.table)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment