Skip to content

Instantly share code, notes, and snippets.

@DOGEME
Created January 11, 2012 06:53
Show Gist options
  • Save DOGEME/1593448 to your computer and use it in GitHub Desktop.
Save DOGEME/1593448 to your computer and use it in GitHub Desktop.
オギョヒーっていう時用 / earthquake.gem plugin
# -*- coding: utf-8 -*-
# ogyohee tweet / earthquake plugin
#
# ogyohee: http://shindanmaker.com/152454
#
require 'httpclient'
Earthquake.init do
command :ogyohee do
url = "http://shindanmaker.com/152454"
html = HTTPClient.new.post(url, { :u => rand(Time.now.to_i), :from => ""} )
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