Created
May 31, 2015 17:30
-
-
Save Benzi/b58d460b30db93160c70 to your computer and use it in GitHub Desktop.
Returns link to current song playing in plug.dj community
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function() { | |
| var media = API.getMedia(); | |
| var linkToSong = null; | |
| if (media.format === 1) { | |
| linkToSong = "http://youtu.be/" + media.cid; | |
| console.log(linkToSong); | |
| API.chatLog(linkToSong); | |
| } | |
| if (media.format === 2) { | |
| SC.get('/tracks/' + media.cid, function (sound) { | |
| linkToSong = sound.permalink_url; | |
| console.log(linkToSong); | |
| API.chatLog(linkToSong); | |
| }); | |
| } | |
| // Credit: Benzi (Benzi Mooneegan) | |
| }()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment