Created
June 6, 2012 15:12
-
-
Save kaneshin/2882521 to your computer and use it in GitHub Desktop.
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
let url = 'http://www.tepco.co.jp' | |
let indexj = '/cc/press/index-j.html' | |
let res = webapi#http#get(url.indexj) | |
if res.header[0] != 'HTTP/1.1 200 OK' | |
echo 'Oops! Something wrong.' | |
endif | |
let data = iconv(res.content, 'utf-8', &encoding) | |
for list in split(data, '\n') | |
if list =~ '<dd><a href="' | |
if matchstr(list, '<dd><a href=".\+">\zs.\+\ze<\/a><\/dd>') | |
\=~ '午後3時現在' | |
echo matchstr(list, '<dd><a href=".\+">\zs.\+\ze<\/a><\/dd>') | |
echo url.matchstr(list, '<dd><a href="\zs.\+\ze">.*') | |
endif | |
endif | |
endfor |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment