Created
June 13, 2013 16:31
-
-
Save hagiyaki/5775180 to your computer and use it in GitHub Desktop.
hagiyakiスーパードラァイ
This file contains hidden or 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
# -*- 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