Skip to content

Instantly share code, notes, and snippets.

View wush978's full-sized avatar
👶
Working with my baby

Wush Wu wush978

👶
Working with my baby
View GitHub Profile
@wush978
wush978 / lol.R
Created November 19, 2013 14:53 — forked from anonymous/lol.R
library(XML)
library(RCurl)
url <- "http://loltw.gamebase.com.tw/summoner/TW/AZB_TPS_MiSTakE/monthly_stats#mstat-201311-RANKED_SOLO_5x5"
src <- getURL(url)
doc <- htmlParse(src)
div <- doc['//div[@id="mstat-201311-RANKED_SOLO_5x5"]//table/tbody/tr/td']
row.index.start <- which(sapply(div, function(a) length(a['br'])) > 0)
extract_br <- function(a) {
src <- paste(capture.output(print(a)), collapse="\n")
# * 結構說明
#
# 群組
# 規則名稱
# Regex 字串
# 關鍵字跟位置的對應表
#
# match_any is a special string for resuing regex
---
_alias: