What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Request] XBMC now playing

[Request] XBMC now playing
Author: Message:
Horscht
New Member
*


Posts: 3
38 / Male / –
Joined: Feb 2007
O.P. [Request] XBMC now playing
Hi

Sorry to ask for something to be done. I don't want to sound demanding or anything like that, but I know nothing about scripting.

I am running an xbox with XBMC (Xbox Media Center, Media Center application for the Xbox, obviously). The Xbox is networked to my computer which runs the latest version of WLM with MP!. There is an easy command to query what is currently playing on it.

http://192.168.0.23/xbmcCmds/xbmcHttp?command=getcurrentlyplaying

with 192.168.0.23 being the ip of the xbox in the Local Network, this simple command allows to retrieve that information.

and this is the html sourcecode of the page that results from queriyng this url:

code:
<html>
<li>Filename:F:\Music\I\Iron Maiden\The Number Of The Beast\Iron Maiden - Gangland.mp3
<li>SongNo:0
<li>Type:Audio
<li>Title:Gangland
<li>Artist:Iron Maiden
<li>Album:The Number of the Beast
<li>Genre:Metal
<li>Year:1998
<li>Bitrate:130
<li>Samplerate:44
<li>Thumb:q:\userdata\Thumbnails\Music\ecd3458e.tbn
<li>PlayStatus:Playing
<li>Time:0:01
<li>Duration:3:46
<li>Percentage:0
<li>File size:3674112</html>


shouldn't it be quite simple to query this url every thirty seconds and display song information in WLM? If so, could anyone be so kind and write an MP! script for that purpose? Again, I am sorry to ask this, but I am clueless on how one would be able to do that, so I appologise if one is not allowed to make request.

Thanks in advance

Horscht
02-08-2007 05:47 PM
Profile E-Mail PM Find Quote Report
Stigmata
Veteran Member
*****



Posts: 3520
Reputation: 45
21 / Other / Flag
Joined: Jul 2003
RE: [Request] XBMC now playing
Ok here is a tester.. it will get the artist and track and pop it up in a alert box (Want to make sure it works).

Just tell me if it works, then tell me what other features you want and I'll release it as a proper script

:)

.plsc File Attachment: XBMC Now Playing.plsc (1.22 KB)
This file has been downloaded 303 time(s).
02-08-2007 07:29 PM
Profile PM Web Find Quote Report
Horscht
New Member
*


Posts: 3
38 / Male / –
Joined: Feb 2007
O.P. RE: [Request] XBMC now playing
Ok, tested this script. a popup allert poped up, but it told me

Iron Maide
The Apparitio

but I was playing a totaly different song. manualy getting to the webserver url gave a page with the correct artist information. sourcecode follows:

code:
<html>
<li>Filename:F:\Music\S\Shadows Fall\The War Within\Shadows Fall - The Light That Blinds.mp3
<li>SongNo:0
<li>Type:Audio
<li>Title:The Light That Blinds
<li>Artist:Shadows Fall
<li>Album:The War Within
<li>Genre:Metal
<li>Year:2004
<li>Bitrate:267
<li>Samplerate:44
<li>Thumb:q:\userdata\Thumbnails\Music\f1ca1899.tbn
<li>PlayStatus:Playing
<li>Time:1:26
<li>Duration:4:58
<li>Percentage:29
<li>File size:9973760</html>


I have no clue where it got that Iron Maiden info from.

EDIT: I tried loading it again, this time it got the right information (Atreyu Right side of the bed) . what value is the timer set to? It should be a lot less, like refreshing the song information every 30 seconds. not too often though (not less than every 10 seconds). Also, it cuts of the last letter of the Artist and the Song title. Small bug I supose. And it would be great if one could set the ip via a small dialog. And maybe some configurable information layout. So you could decide wether it should display "Artist - Album - Title" or "Title - Artist" etc.


EDIT2: Even after playing 5 Songs on xbmc the script still tells me "Atrey right side of the be" whenever i deactive-activate it...

This post was edited on 02-08-2007 at 08:15 PM by Horscht.
02-08-2007 07:56 PM
Profile E-Mail PM Find Quote Report
Silentdragon
Full Member
***

Avatar
if(life==null && wrists) EmoAlert();

Posts: 148
Reputation: 2
34 / Male / –
Joined: Jun 2006
RE: [Request] XBMC now playing
I had a script that did this:
-Takes a screenshot of the screen, sends it to the pc, and converts it to a jpg, which is then sent to contact.
-Clears it's cache, so the song is updated
-Shows it in the Now Playing of MSN
-If the file is locally stored can send that file to the person(Must be tweaked to your system)
-Even had controls like, next, previous, ect.

Someone may have a copy of it, if they ever visted my old website, but the site itself is gone without backups. XBMC.plsc/zip

This however may be useful if you need a screenshot function. http://www.mpscripts.net/code.php?id=18
You might want to explicitly clear the cache too. I always had issues of it reporting the wrong info after awhile.
02-08-2007 09:58 PM
Profile E-Mail PM Web Find Quote Report
Volv
Skinning Contest Winner
*****

Avatar

Posts: 1233
Reputation: 31
35 / Male / Flag
Joined: Oct 2004
RE: [Request] XBMC now playing
Also Stigmata, I'm not sure if you have an XBOX with XBMC or are just scripting this specifically for Horscht, but it is worth noting that in order to do this the user must first enable the Web Server (which is by default disabled) on their XBMC dashboard by going to Settings > Network > Servers then checking the 'Enable Web Server' checkbox and having the following settings;
Web Server Port: 80
Web Server Password: No Pass
(Otherwise the script will need to be able to handle these)
Also like Horscht suggested being able to change the IP from which the data is retrieved from a User Interface as opposed to editing the code would be good as each LAN is bound to have different IP ranges assigned eg. my XBOX is http://10.0.0.2/....

Also, if no song is playing the following HTML is returned;
code:
<html>
<li>Filename:[Nothing Playing]</html>

If a video is playing the following was returned;
code:
<html>
<li>Filename:E:\videos\Star Wars Clone Wars - Volume 1.avi
<li>SongNo:0
<li>Type:Video
<li>Title:Star Wars Clone Wars - Volume 1.avi
<li>Time:00:00:04
<li>Duration:01:09:30
<li>Percentage:0</html>

If an image is being viewed (even whilst music is playing);
code:
<html>
<li>Filename:Q:\screenshots\screenshot000.bmp
<li>Type:Picture
<li>Width:720
<li>Height:576
<li>Thumb:Q:\thumbs\2\24de9116.tbn</html>

If a DVD Video is being played;
code:
<html>
<li>Filename:dvd://1
<li>SongNo:-1
<li>Type:Video
<li>Title:LONGEST_YARD
<li>Time:00:00:03
<li>Duration:00:00:22
<li>Percentage:15</html>
(I think this would just use the same code as other videos and i imagine VCDs etc. would yield the same)

No data is retrieved whilst playing games (and I'm assuming with other applications as well) since the dashboard (and hence its webserver) is no longer running whilst this is happening.

Anyway, the key to this would be determining the 'Type' field first and then determining which fields to get (eg. videos dont have Artist fields whereas songs do). You would also have to 'remember' which songs are playing because if the user is browsing images whilst listening to music the music details will not be displayed on the page (this is probably the biggest problem).

PS: Sorry if you already have an xbox and know all this, meaning I've just wasted the last 10 minutes :p

EDIT: Did code tags always have emoticons enabled? =/

quote:
Originally posted by Horscht
Even after playing 5 Songs on xbmc the script still tells me "Atrey right side of the be" whenever i deactive-activate it...
This sounds a lot like a caching issue but I have not tried the script yet so I cannot confirm.
EDIT2: Have now tried the script and can confirm that this is an issue and that it is indeed a caching issue, after deleting Temporary Internet Files from Internet Explorer the song is properly updated but then remains the same again. A cheap work around for this is editing the URL every time it is retrieved by adding a random number at the end eg;
code:
var rndNum = Math.random()*1000;
...
http.open('GET', url + '&rand=' + rndNum, true);

quote:
Originally posted by Horscht
Also, it cuts of the last letter of the Artist and the Song title
This is because there is only a Line Feed character between lines, there is no Carriage Return whereas the script acts as though there is both control characters present, this should be relatively easily fixed.

This post was edited on 02-09-2007 at 02:37 AM by Volv.
02-09-2007 01:51 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On