spotify.coffee
module.exports= (robot) -> |
api_url=process.env.HUBOT_SPOTIFY_MAC_API_URL |
api_secret=process.env.HUBOT_SPOTIFY_MAC_API_SECRET |
options= {} |
options.commands= [ |
'play (track|artist|album) <name> - Play a given track, artist or album', |
'play queue <1,2,3> - Play a given search result', |
'pause - Pause the current song', |
'toggle - Play/pause the current song', |
'next - Play the next song from the playlist', |
'previous - Play the previous song from the playlist', |
'current song - Shows what song I'm currently playing', |
'mute - Mute/unmute the sound', |
'search (track|album|artist) <query> - Search for a track on Spotify and queue it to be played' |
] |
# starting volume in spotify |
options.volume=100 |
robot.respond/spotify$/i, (msg) -> |
msg.sendoptions.commands.join('n') |
# controls |
robot.respond/toggle$/i, (msg) -> |
msg.send'Okay, toggling play/pause in Spotify' |
robot.http(api_url+'/toggle') |
.header('Content-Type', 'application/x-www-form-urlencoded') |
.post('secret='+api_secret) (err, res, body) -> |
# your code here |
robot.respond/play$/i, (msg) -> |
msg.send'Playing the current song in Spotify' |
robot.http(api_url+'/play') |
.header('Content-Type', 'application/x-www-form-urlencoded') |
.post('secret='+api_secret) (err, res, body) -> |
# your code here |
robot.respond/(pause|stop)$/i, (msg) -> |
msg.send'Pausing the current song in Spotify' |
robot.http(api_url+'/pause') |
.header('Content-Type', 'application/x-www-form-urlencoded') |
.post('secret='+api_secret) (err, res, body) -> |
# your code here |
robot.respond/(next|play next|play the next song)$/i, (msg) -> |
robot.http(api_url+'/next') |
.header('Content-Type', 'application/x-www-form-urlencoded') |
.post('secret='+api_secret) (err, res, body) -> |
msg.send'And now I'm playing '+ body |
robot.respond/(previous|prev|play previous|play the previous song)$/i, (msg) -> |
robot.http(api_url+'/prev') |
.header('Content-Type', 'application/x-www-form-urlencoded') |
.post('secret='+api_secret) (err, res, body) -> |
msg.send'Playing this song again: '+ body |
robot.respond/mute$/i, (msg) -> |
robot.http(api_url+'/mute') |
.header('Content-Type', 'application/x-www-form-urlencoded') |
.post('secret='+api_secret) (err, res, body) -> |
msg.send body |
robot.respond/unmute$/i, (msg) -> |
robot.http(api_url+'/mute') |
.header('Content-Type', 'application/x-www-form-urlencoded') |
.post('secret='+api_secret) (err, res, body) -> |
msg.send body |
robot.respond/(current|song|track|current song|current track)$/i, (msg) -> |
robot.http(api_url+'/playing') |
.header('Content-Type', 'application/x-www-form-urlencoded') |
.post('secret='+api_secret) (err, res, body) -> |
msg.send'The current song I'm playing is '+ body |
robot.respond/search ?(track|song|album|artist)? (.*)$/i, (msg) -> |
query=msg.match[2] |
ifmsg.match[1]? |
switchmsg.match[1] |
when'track'or'song'thentype='track' |
when'album'thentype='album' |
when'artist'thentype='artist' |
else |
type='track' |
data='secret='+api_secret+'&type='+encodeURIComponent(type)+'&query='+encodeURIComponent(query) |
robot.http(api_url+'/search') |
.header('Content-Type', 'application/x-www-form-urlencoded') |
.post(data) (err, res, body) -> |
msg.send body |
robot.respond/play ?(track|album|artist|queue)? (.*)$/i, (msg) -> |
play_type=encodeURIComponent(msg.match[1]) |
query=encodeURIComponent(msg.match[2]) |
url=String(api_url +'/play/'+ play_type +'/'+ query) |
robot.http(url) |
.header('Content-Type', 'application/x-www-form-urlencoded') |
.post('secret='+api_secret) (err, res, body) -> |
msg.send body |
Spotify App For Mac
Spotify Playlist Downloader With Windows GUI. Download an entire spotify playlist (160kbps mp3's) to your local machine with a simple interface. Kodi download on firestick 2018. When it starts downloading it checks if you already downloaded the song if so it skips it. When done downloading it also writes the ID3 data to the file. Jojo mayer secret weapons for the modern drummer pdf download. Aug 10, 2020 Go to the playlist you want to download. Switch Download on. A green arrow indicates the download was successful. Set the app to Offline Mode. Note: In Offline Mode, you can only play music you’ve downloaded. For Mac: In the Apple menu at the top of the screen, click Spotify. Spotify playlist downloader - Download any Spotify Playlists to MP3. Download virtual dj pioneer free. Spotify is a popular music streaming service which offers free and premium plans. Premium subscribers can download Spotify tracks, albums and playlists to the app so you.
Spotify
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment