Skip to content

Instantly share code, notes, and snippets.

@qrush
Last active August 29, 2015 14:13
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 qrush/54de0eccf23e3a5cd51b to your computer and use it in GitHub Desktop.
Save qrush/54de0eccf23e3a5cd51b to your computer and use it in GitHub Desktop.
class NotificationsController < ApplicationController
def create
if subject = params["subject"]
if subject =~ /succeed/
message = ":+1:"
else
message = ":-1:"
end
message << " #{subject}"
if link = Nokogiri::HTML(params["stripped-html"]).at_css("a[href*='bots']")
message << ": #{link["href"]}"
end
# replace with Tinder, or whatever API you use for your chat room!
Dash.announcer.say message
end
head :ok
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment