Skip to content
This repository has been archived by the owner on Oct 28, 2019. It is now read-only.

Commit

Permalink
deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Połtyn committed Sep 5, 2011
1 parent bbf03a3 commit 98c3e6d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions yuno.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ class Yuno < AwesomeBotFactory::Skill
c.details = ""
c.author = "holek"
c.url = "http://abf-yuno.herokuapp.com/yuno"
c.regex = "^(.*)(Y U NO|BUT WHEN I DO|ALL THE) (.+)$"
c.regex = "^(NOT SURE IF|)(.*)(Y U NO|BUT WHEN I DO|ALL THE|OR) (.+)$"
end

matches :text_1, :action, :text_2
matches :prepend, :text_1, :action, :text_2

def reply
image = "http://memecaptain.com/i?u=http%3A%2F%2Fmemecaptain.com%2F"
Expand All @@ -26,7 +26,11 @@ def reply
# ALL THE
image = "http://memecaptain.com/i?u=http%3A%2F%2Ftroll.me%2Fimages%2Fx-all-the-things%2Fx-all-the-things.jpg&tt=#{URI.encode_www_form_component(self.body)}" if self.action == "ALL THE"

image << "#jpg"
# NOT SURE IF ... OR ...
if self.prepend == "NOT SURE IF" && self.action == "OR"
image = "http://memecaptain.com/?u=http%3A%2F%2Fs3.amazonaws.com%2Fkym-assets%2Fphotos%2Fimages%2Foriginal%2F000%2F131%2F399%2Ffry.PNG%3F1307468855&tt=#{URI.encode_www_form_component("#{self.prepend} #{self.text_1}")}&tb=#{URI.encode_www_form_component("#{self.action} #{self.text_2}")}"
end
image << "#jpg" if image
{:type => "TextMessage", :body => image}
end

Expand Down

0 comments on commit 98c3e6d

Please sign in to comment.