Skip to content

Instantly share code, notes, and snippets.

@hagiyaki
Created January 19, 2012 17:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hagiyaki/1641275 to your computer and use it in GitHub Desktop.
Save hagiyaki/1641275 to your computer and use it in GitHub Desktop.
byunしながらスーパードライ earthquake.gem plugin
# -*- coding: utf-8 -*-
# superdry tweet / earthquake plugin
#
# superdry: http://shindanmaker.com/43570
#
require 'httpclient'
Earthquake.init do
command :byunasahi do
url = "http://shindanmaker.com/43570"
html = HTTPClient.new.post(url, { :u => rand(Time.now.to_i), :from => ""} )
r = nil
html.body.split("\n").detect{|e| r = e.match(/>\s+?(.+)\s+#asahisuperdry/)}
text=r[1].force_encoding("UTF-8")
input(text.each_char.inject(""){|s,c| s << "=͟͟#{c}"}) if r
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment