Created
          February 9, 2011 04:22 
        
      - 
      
 - 
        
Save drewconway/817875 to your computer and use it in GitHub Desktop.  
    Function returns quater scores from Wikipedia Super Bown pages
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # 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