Skip to content

Instantly share code, notes, and snippets.

@hagiyaki
Created January 10, 2012 09:25
Show Gist options
  • Select an option

  • Save hagiyaki/1588051 to your computer and use it in GitHub Desktop.

Select an option

Save hagiyaki/1588051 to your computer and use it in GitHub Desktop.
スーパードライ earthquake.gem plugin
# -*- coding: utf-8 -*-
# superdry tweet / earthquake plugin
#
# superdry: http://shindanmaker.com/43570
#
require 'httpclient'
Earthquake.init do
command :asahi 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/)}
input(r[1]) if r
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment