Skip to content

Instantly share code, notes, and snippets.

@siyo
Last active December 19, 2015 21:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save siyo/6021107 to your computer and use it in GitHub Desktop.
Save siyo/6021107 to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
Earthquake.init do
output_filter do |item|
next unless item["user"] && item["text"]
account = item["user"]["screen_name"]
id = item["id"]
txt = item["text"]
res = %w|おいしそう うまそう わたしも食べたい〜 美味しそう|
if /http:\/\/miil\.me\/p\/[\w]+/ =~ txt
twitter.update( "@#{account} #{res.sample} #{'!' * rand(20)} #miil_taisaku", :in_reply_to_status_id =>id )
end
true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment