Skip to content

Instantly share code, notes, and snippets.

@siyo
Created October 31, 2011 00:37
Show Gist options
  • Save siyo/1326652 to your computer and use it in GitHub Desktop.
Save siyo/1326652 to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
#
Earthquake.init do
command %r|:glitch\s*(\d+)*\s*(.*)$|, :as => :glitch do |m|
cmd = m[1] ? ":reply #{m[1]}" : ":update"
s = open(URI.encode("http://glitchstr.makimoto.org/#{m[2]}")){|f| f.read}
input("%s %s" % [cmd, s])
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment