Skip to content

Commit

Permalink
star songs
Browse files Browse the repository at this point in the history
  • Loading branch information
holman committed Nov 8, 2011
1 parent 91e1b28 commit c08e7ad
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/scripts/play.coffee
Expand Up @@ -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) ->
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit c08e7ad

Please sign in to comment.