SQL query - now playing

This forum is for questions / discussions regarding development of addons / tweaks for MediaMonkey.

Moderator: Gurus

gstark

SQL query - now playing

Post by gstark » Mon Sep 08, 2014 9:03 pm

I'm wanting to develop a simple php script that lets me do stuff (like tweet) what I'm currently listening to.

I can find the record in the database for the tune that's just finished playing, but I cannot seem to find where the song that's currently played is recorded.

Help, please. :)

trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Barton, UK
Contact:

Re: SQL query - now playing

Post by trixmoto » Tue Sep 09, 2014 3:30 am

Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE

gstar
Posts: 2
Joined: Mon Sep 08, 2014 8:56 pm

Re: SQL query - now playing

Post by gstar » Tue Sep 09, 2014 6:32 am

Thank you, but that looks like a VB script object. I'm wanting to grab this data using php.

trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Barton, UK
Contact:

Re: SQL query - now playing

Post by trixmoto » Tue Sep 09, 2014 4:49 pm

You can access the object using php as well... http://php.net/manual/en/class.com.php

I don't think the database is updated when a track starts playing, but you could maybe create a script that did.

Or you could look at my Now Playing FTP script. This would use FTP to upload a file to your website with the details and then your php script could read the file.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE

gstar
Posts: 2
Joined: Mon Sep 08, 2014 8:56 pm

Re: SQL query - now playing

Post by gstar » Thu Sep 11, 2014 1:41 am

Thanks for your help.

Like Thursdays, I never could get the hang of com objects; I guess I'm not a com object kind of guy - been doing this stuff way too long. And getting way too old. :)

That said, I've been able to get what I wanted done using the event logger's output, and I've now got some PHP script working using either MySQL or SQLite, and automatically posting the details of the current song being played to my Twitter account.

Should be portable across LAMP/WAMP/XAMP provided that there's access to the event logger's output.

Post Reply