Skip to content

Instantly share code, notes, and snippets.

@akouryy
Created March 4, 2015 13:51
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 akouryy/e1f15aa906f6e87fde2c to your computer and use it in GitHub Desktop.
Save akouryy/e1f15aa906f6e87fde2c to your computer and use it in GitHub Desktop.
# coding: utf-8
require "yaml"
on_event(:tweet) do |obj|
case obj.text
when /^(?!RT)@#{screen_name}\s+(omikuji|おみくじ)/
om = YAML.load_file(@data+"/omikuji.yml")[0]
category = { type: "", love: "恋愛", dream: "夢", money: "金銭", study: "学業", progress: "進捗" }
text = category.map{|label, name| "#{name}:#{om[label.to_s].sample}" }.join "\n"
mention(obj,"#{text}\n#{Time.now}")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment