Deprecated: Use of "parent" in callables is deprecated in /var/www/html/forum/src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php on line 431
  • If you need help or want to discuss things, you now can also join us on our Discord Server!
  • A first preview of the unlimited version of SinusBot can be found in the Upcoming Changes thread. A version for Windows will follow, but we don't have a release date, yet.

EN "Announce tracks" output to website

Status
Not open for further replies.

Russo

New Member
Hi, in the instance settings there is an option for the bot to "Announce tracks", for me it says " Now playing %s"

I would like to output the track to my site.

What i mean by that, is this: When the bot says "Now playing ** random radio song **, i want it to make a connection to my site url with the follow strings "current radio ID" and the "string of current song that is playing".

like, when it detects that the bot is playing and when it says on TS "now playing ** random radio ** i want the bot to direct the information of the radio id and song to the follow url:

http://www.mysite.com/myphpscript.php?radioid=RADIO_ID_HERE&trackid=TRACK_THAT_THE_BOT_SAYS_ON_TS

radioid would be the number of the radio that i see on my panel( http://HOST:8087/play/files)
trackid is the song that the bot says on the team speak server.

So all i need is the script to output "RADIO_ID" and "TRACK_ID", i can edit the url and do whatever i want with the info i got from the bot.

It would be easy if i could edit the part of the script that call this function, then in theory, i would just need to add a small code for the bot to hit my website with the radio id and song name.
 

flyth

is reticulating splines
Staff member
Developer
Contributor
Write a small script, listen for the event trackInfo / track and then use sinusbot.http() (use forumsearch, sadly I haven't ported that call to the new engine, yet) to post the info to your website.
 

Russo

New Member
Write a small script, listen for the event trackInfo / track and then use sinusbot.http() (use forumsearch, sadly I haven't ported that call to the new engine, yet) to post the info to your website.

thx :), i didnt create my own script, i just edited one that i was already using "aloneMode.js"

i added the follow lines:
Code:
sinusbot.on('trackInfo', function(ev) {
        // Do something...
        sinusbot.log('title: ' + ev.title + ' Music: ' + ev.tempTitle + ' - ' + ev.tempArtist);
        var out = sinusbot.http({ method: 'GET', url: 'https://www.mysite.com/stinfo.php?pass=MY_PASS&title=' + encodeURIComponent(ev.title) + '&tempt=' + encodeURIComponent(ev.tempTitle) + '&tempa=' + encodeURIComponent(ev.tempArtist) });

    });

its perfect, the title is the title from the music list, so i can control it and in the php, i can detect the title, compare, see if tempArtist or tempTitle is undefined, etc...

;)
 
Status
Not open for further replies.
Top