Created
April 14, 2010 16:41
-
-
Save champierre/366033 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env ruby | |
require "rubygems" | |
require "twitter" | |
require "nokogiri" | |
require "open-uri" | |
url = "http://userscripts.org/scripts/show/73877" | |
doc = Nokogiri::HTML(open(url).read) # Ruby 1.8.6 では read が必要。1.8.7 では不要。 | |
doc.css("#details").text[/(\d+) times/] | |
count = $1 | |
httpauth = Twitter::HTTPAuth.new('bot_account', 'password') | |
client = Twitter::Base.new(httpauth) | |
client.update("@my_account Libron グリモン版ダウンロード数 #{count} http://bit.ly/bCSIrd") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment