Skip to content

Instantly share code, notes, and snippets.

@champierre
Created April 14, 2010 16:41
Show Gist options
  • Save champierre/366033 to your computer and use it in GitHub Desktop.
Save champierre/366033 to your computer and use it in GitHub Desktop.
#!/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