Skip to content

Instantly share code, notes, and snippets.

@kenjiskywalker
Created November 21, 2013 17:07
Show Gist options
  • Select an option

  • Save kenjiskywalker/7585607 to your computer and use it in GitHub Desktop.

Select an option

Save kenjiskywalker/7585607 to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
# tetsuko tweet / earthquake plugin
#
# superdry: http://shindanmaker.com/a/409109
#
require 'httpclient'
require 'nokogiri'
Earthquake.init do
command :tetsuko do
url = "http://shindanmaker.com/a/409109"
u = rand(Time.now.to_i)
res = HTTPClient.new.post(url, { :u => u, :from => ""} )
html = Nokogiri::HTML(res.body)
text = html.css("#forcopy").text.strip
if confirm(text)
twitter.update text
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment