Skip to content

Instantly share code, notes, and snippets.

@masui
Created October 8, 2012 07:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masui/3851121 to your computer and use it in GitHub Desktop.
Save masui/3851121 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'nokogiri'
require 'open-uri'
doc = Nokogiri::HTML(open('http://enoshima-yacht-harbor.jp/kishou.htm'))
tds=doc.xpath("//td")
as = tds[16].xpath(".//b").text.sub(/[^\d\.].*$/,'')
ad = tds[19].xpath(".//b").text
ms = tds[22].xpath(".//b").text.sub(/[^\d\.].*$/,'')
md = tds[25].xpath(".//b").text
cmd = "echo '#{as} #{ad} #{ms} #{md} (#{Time.now})' | tw --user=enoshimawind --pipe"
puts cmd
system cmd
@masui
Copy link
Author

masui commented Oct 8, 2012

江ノ島の風速をtweetする

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment