Skip to content

Instantly share code, notes, and snippets.

@siyo
Created August 5, 2012 02:45
Show Gist options
  • Save siyo/3261236 to your computer and use it in GitHub Desktop.
Save siyo/3261236 to your computer and use it in GitHub Desktop.
エロキモいBBQ中にツイッターしたくなったとき用のプラギン
# -*- coding: utf-8 -*-
# erobbq tweet / earthquake plugin
#
require 'httpclient'
Earthquake.init do
command :erobbq do
url = "http://shindanmaker.com/168737"
html = HTTPClient.new.post(url, { :u => rand(Time.now.to_f), :from => ""} )
r = nil
html.body.split("\n").detect{|e| r = e.match(/>\s+?(.+)#{url}/)}
if r
input( open(URI.encode("http://erokimos.jgate.de/convert?q=#{r[1]}")){|f| f.read} )
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment