Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

tinder notifications on new signup

  • Loading branch information...
commit 34a2ad2f6cff9bbaedcb66bfb3fda9bf9bc0b47a 1 parent 4c77f6d
@schacon schacon authored
Showing with 20 additions and 0 deletions.
  1. +1 −0  Gemfile
  2. +10 −0 Gemfile.lock
  3. +9 −0 dodgeball.rb
View
1  Gemfile
@@ -7,6 +7,7 @@ gem "dm-core"
gem "dm-migrations"
gem "dm-validations"
gem "dm-timestamps"
+gem "heroku"
gem "tinder"
View
10 Gemfile.lock
@@ -35,8 +35,15 @@ GEM
faraday_middleware (0.6.5)
faraday (~> 0.6.0)
hashie (1.1.0)
+ heroku (2.7.0)
+ launchy (>= 0.3.2)
+ rest-client (~> 1.6.1)
+ rubyzip
+ term-ansicolor (~> 1.0.5)
http_parser.rb (0.5.2)
json (1.6.1)
+ launchy (2.0.5)
+ addressable (~> 2.2.6)
mime-types (1.16)
multi_json (1.0.3)
multipart-post (1.1.3)
@@ -47,6 +54,7 @@ GEM
rack (1.3.3)
rest-client (1.6.7)
mime-types (>= 1.16)
+ rubyzip (0.9.4)
shotgun (0.9)
rack (>= 1.0)
simple_oauth (0.1.5)
@@ -60,6 +68,7 @@ GEM
sqlite3 (1.3.4)
sqlite3-ruby (1.3.3)
sqlite3 (>= 1.3.3)
+ term-ansicolor (1.0.6)
tilt (1.3.3)
tinder (1.7.0)
activesupport (< 4, >= 2.3)
@@ -92,6 +101,7 @@ DEPENDENCIES
dm-sqlite-adapter
dm-timestamps
dm-validations
+ heroku
pg
shotgun
sinatra
View
9 dodgeball.rb
@@ -5,6 +5,8 @@
require 'dm-validations'
require 'dm-timestamps'
+require 'tinder'
+
## -- DATABASE STUFF --
DataMapper.setup(:default, ENV['DATABASE_URL'] || "sqlite3://#{Dir.pwd}/local.db")
@@ -66,6 +68,12 @@ class Dodgeball < Sinatra::Base
enable :sessions
set :session_secret, "8c23f5ecdef9c54b81244e5426727279"
+ def notify_campfire(team)
+ hubot = Tinder::Campfire.new ENV['CF_GROUP'], :token => ENV['CF_TOKEN']
+ room = hubot.find_room_by_name(ENV['CF_ROOM'])
+ room.speak "new dodgeball signup: #{team.name} of #{team.company}"
+ end
+
def get_data
@teams = Team.all(:cool => true)
@pot = 0
@@ -171,6 +179,7 @@ def authorized?
@team = Team.new
fill_team(@team, params)
if @team.save
+ notify_campfire(@team)
redirect '/thankyou'
else
get_data
Please sign in to comment.
Something went wrong with that request. Please try again.