Skip to content

Instantly share code, notes, and snippets.

@kaneshin
Created June 6, 2012 15:12
Show Gist options
  • Save kaneshin/2882521 to your computer and use it in GitHub Desktop.
Save kaneshin/2882521 to your computer and use it in GitHub Desktop.
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