-
-
Save morygonzalez/1611350 to your computer and use it in GitHub Desktop.
オギョヒーっていう時用 / earthquake.gem plugin
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 -*- | |
# ogyohee tweet / earthquake plugin | |
# | |
# ogyohee: http://shindanmaker.com/152454 | |
# | |
require 'net/http' | |
Earthquake.init do | |
command %r|^:ogyo\s*(.+)*|, :as => :ogyohee do |m| | |
url = "http://shindanmaker.com/152454" | |
c = m[1].nil? ? rand(Time.now.to_i) : m[1] | |
html = Net::HTTP.post_form(URI.parse(url), { :u => c }) | |
r = nil | |
html.body.split("\n").detect{|e| r = e.match(/>\s+?(.+)#{url}/)} | |
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