This file contains 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
# go to 'https://developers.facebook.com/tools/explorer' to get your access token | |
access_token <- "******************* INPUT YOUR ACCESS TOKEN ******************************" | |
require(RCurl) | |
require(rjson) | |
# Facebook json function copied from original (Romain Francois) post | |
facebook <- function( path = "me", access_token, options){ | |
if( !missing(options) ){ | |
options <- sprintf( "?%s", paste( names(options), "=", unlist(options), collapse = "&", sep = "" ) ) |
This file contains 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
require(RCurl) | |
require(rjson) | |
require(XML) | |
url = 'http://cn.soccerway.com/a/block_competition_matches?block_id=page_competition_1_block_competition_matches_7&callback_params=%7B%22page%22%3A%22-1%22%2C%22round_id%22%3A%2217950%22%2C%22outgroup%22%3A%22%22%2C%22view%22%3A%222%22%7D&action=changePage¶ms=%7B%22page%22%3A0%7D' | |
doc = getURL(url) | |
txt = fromJSON(doc)$commands[[1]]$parameters$content | |
tab = readHTMLTable(htmlParse(txt, encoding = 'utf-8'))[[1]] |