XM and whole house audio

IVB said:
sorry, i'm still lost. I've looked all through that forum accessX10 linked to, and I can't figure out how to get at the list of songs playing on each channel without logging in.

Anyone?
IVB, what is happening is code is programmed to go to a URL on the XRMO(xm radio server)online and it then scrapes the page that shows the listings of all channels/artists and displays them in someones IDE..this is what something like Xamp does and as mentioned Mainlobby...they are simply querying the url and then parsing that page and grabbing the data they need and putting it into their own DB's so their program can access and use it.

Many programmmers can do this sort of stuff fairly easy by using expressions and parsing a html/xml document and grabbing what they need but the problem one always has to consider is at any time the source(XMRO) can change their code and render your app useless...Dean could probably code this sort of thing in a few hours to grab us the same data but I'm sure he would have to worry about lthe legal aspect of it, if he was to offer a driver that utilized the XMRO servers to make his commercial product better he would possibly open himself up to lawsuits.

Many people know whats needed to interact with xmro but one always has to consider it could die at any time and not work again, it can provide all channel data as artist data as well as full length track/artist names BUT at any time XM can block access if they choose.

People have been scraping xmro data since about 2001..so far all is well and things are working fine, tomorrow XM could say no more and change code in such a way that people can't scrape that data.

**IVB you mention no way to see the data without logging in, the way mainlobby does this in the XMlobby plugin you need to give you username/password for xmonline in the driver preferences...you do this and their code places your username/password in a string that get's sent to XMRO..it sees its a a valid request and they are able to parse the data and place it in their DB where their flash app later retrieves it...the code probably places a request every 5-10 seconds and keeps grabbing the data and parsing it.

**IVB..their is some perl code I have that will allow you to access xmro and you basically use your username/pass in the code and can parse the results...it is a basic login and parsing and I'm sure it is the same code Dave used to make Xmlobby..it was released about 2 years ago on XM4111.com, to make it work you will need to know perl and xml but I have it somewhere if you ever need it or I can find for you.
 
IVB here is the perl code I mentioned, of course this a basic example but if you know perl you will understand how this works and can modify to suit your needs.

Code:
Script below:

#!/usr/bin/perl

use strict;
use Data::Dumper;
use LWP::UserAgent;
use HTTP::Request::Common;
use XML::Simple;

my $login_url = 'http://xmro.xmradio.com/xstream/login_servlet.jsp';
my $data_url = 'http://player.xmradio.com/padData/pad_data_servlet.jsp';

my $username = 'ENTER EMAIL';
my $password = 'YOUR PASSWORD';

my $ua = LWP::UserAgent->new;
$ua->cookie_jar({});

#use HTTP::Cookies;
#$ua->cookie_jar(HTTP::Cookies->new(file => 'cookies.txt',
# autosave => 1));

my $rep = $ua->request(POST $login_url,
[user_id => $username,
pword => $password]);

my $data = $ua->request(GET $data_url.'?channel=8');

my $xml = XML::Simple->new();
my $xml_data = $xml->XMLin($data->{_content});

# print Dumper $xml_data;

print "Channel Number: " . $xml_data->{event}->{channelnumber};
print " ($xml_data->{event}->{channelname})\n";
print "Current Artist: " . $xml_data->{event}->{artist} . "\n";
print "Song Title: " . $xml_data->{event}->{songtitle} . "\n";
print "Album: " . $xml_data->{event}->{album} . "\n";
 
Got it, thanks so much for that. Using Perl/XML makes me realize why there's a requirement for hardware to tune XM.

However, if you're going to do something that could be broken by XMRO on screen change, why wouldn't you just use something like Silk to do the login & maintain it, which would also allow you to use XMRO to tune stations and send to the PC-output? I know that's not a "regular" PC langugage and more for testing, but it'd work fine for this.

Also, thanks for the code. I don't care that much about it myself, but I may take a crack at integrating this just to see how the concept works. It's a nice "night-time" project for when i'm now allowed to muck with the Elk or run cables...
 
Back
Top