Skip to content
Browse files

star songs

  • Loading branch information...
1 parent 91e1b28 commit c08e7ad100a48d44d912ff4db0fdbf090d692ca4 @holman holman committed Nov 7, 2011
Showing with 15 additions and 0 deletions.
  1. +15 −0 src/scripts/play.coffee
View
15 src/scripts/play.coffee
@@ -94,6 +94,7 @@ module.exports = (robot) ->
return if message.match[1] == 'stats'
return if message.match[1].split(' ')[0] == 'song'
return if message.match[1].split(' ')[0] == 'album'
+ return if message.match[1].split(' ')[0] == 'something'
message.http("#{URL}/add_artist")
.query(user_login: message.message.user.githubLogin, artist_name: message.match[1])
.post() (err, res, body) ->
@@ -126,6 +127,20 @@ module.exports = (robot) ->
else
message.send("Never heard of it.")
+ robot.respond /(I like|star) this song/i, (message) ->
+ message.http("#{URL}/star_now_playing")
+ .query(user_login: message.message.user.githubLogin)
+ .post() (err, res, body) ->
+ json = JSON.parse(body)
+ message.send("You have a weird taste in music, but I'll remember it.")
+
+ robot.respond /play something i('d)? like/i, (message) ->
+ message.http("#{URL}/play_stars")
+ .query(user_login: message.message.user.githubLogin)
+ .post() (err, res, body) ->
+ json = JSON.parse(body)
+ message.send("Queued up " + json.song_title + " by " + json.artist_name)
+
robot.respond /I want this song/i, (message) ->
message.http("#{URL}/now_playing").get() (err, res, body) ->
json = JSON.parse(body)

0 comments on commit c08e7ad

Please sign in to comment.
Something went wrong with that request. Please try again.