Skip to content

Instantly share code, notes, and snippets.

@hagiyaki
Created June 13, 2013 16:31
Show Gist options
  • Save hagiyaki/5775180 to your computer and use it in GitHub Desktop.
Save hagiyaki/5775180 to your computer and use it in GitHub Desktop.
hagiyakiスーパードラァイ
# -*- coding: utf-8 -*-
# hagiyakisuperdry tweet / earthquake plugin
#
# superdry: http://shindanmaker.com/43570
#
require 'httpclient'
require 'nokogiri'
Earthquake.init do
command :hagi do
url = "http://shindanmaker.com/43570"
res = HTTPClient.new.post(url, { :u => rand(Time.now.to_i), :from => ""} )
html = Nokogiri::HTML(res.body)
text = html.css("#forcopy").text.strip
input text.force_encoding('utf-8').gsub("アサヒィ","ハギヤキィ").gsub("asahi","hagiyaki").gsub(/ http.*/,"")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment