Home AMX User Forum AMX Technical Discussion

XM Music Info

Does anybody know of a way to get the "Now Playing" info from the web to parse?

Besides getting a subscription and a seperate XM tuner with serial info.

The basic subscription issued with DirecTV is what is being used as the XM Source.

Not sure if it possible/legal.

Thanks

Comments

  • jjamesjjames Posts: 2,908
    I did that a while back, but haven't worked much on it. [EDIT] Found the code. See below.[/EDIT]

    Not sure on the legality of it.

    As a side note, I know it's possible to get the info for Sirius quite easily.
    DATA_EVENT[dvXM2]
    {
    	ONLINE:
    	{
    		cXM_BUFFER2 = ''
    		CLEAR_BUFFER cXM_BUFFER2
    		// http://www.xmradio.com/padData/pad_provider.jsp?all_channels=true
    		SEND_STRING dvXM2,"'GET /padData/pad_provider.jsp?all_channels=true HTTP/1.1',13,10,'Host: www.xmradio.com',13,10,13,10"
    		WAIT_UNTIL(FIND_STRING(cXM_BUFFER2,'</paddata>',1))
    			IP_CLIENT_CLOSE(dvXM2.PORT)
    	}
    	
    	OFFLINE:
    	{	
    		LOCAL_VAR CHAR cTEMP_STRING[450]
    		LOCAL_VAR CHAR cARTIST[100];
    		LOCAL_VAR CHAR cSONG[100]
    		LOCAL_VAR CHAR cChannel[100];
    		LOCAL_VAR INTEGER nCHANNEL;
    		
    		IF(FIND_STRING(cXM_BUFFER2,'</paddata>',1))
    		{
    			REMOVE_STRING(cXM_BUFFER2,'</authenticateduser>',1)
    			WHILE(FIND_STRING(cXM_BUFFER2,'</event>',1))
    			{
    				cTEMP_STRING = ''
    				cTEMP_STRING =
    					REMOVE_STRING(cXM_BUFFER2,'</event>',FIND_STRING(cXM_BUFFER2,'<event>',1))
    				
    				cChannel = REMOVE_STRING(cTEMP_STRING,'</channelnumber>',FIND_STRING(cTEMP_STRING,'<channelnumber>',1))
    				STRING_REMOVE(cChannel,'<channelnumber>');
    				STRING_REMOVE(cChannel,'</channelnumber>');
    				
    				nCHANNEL = ATOI(cChannel);
    				IF(nCHANNEL <= nMAX_XM_CHAN)
    				{
    					cARTIST = 
    						REMOVE_STRING(cTEMP_STRING,'</artist>',FIND_STRING(cTEMP_STRING,'<artist>',1))
    					
    					STRING_REMOVE(cARTIST,'<artist>');
    					STRING_REMOVE(cARTIST,'</artist>');
    						
    					cSONG = 
    						REMOVE_STRING(cTEMP_STRING,'</songtitle>',FIND_STRING(cTEMP_STRING,'<songtitle>',1))
    					
    					
    					STRING_REMOVE(cSONG,'<songtitle>');
    					STRING_REMOVE(cSONG,'</songtitle>');
    						
    					IF(FIND_STRING(cSONG,'&amp;',1))
    						STRING_REPLACE(cSONG,'&amp;','&');
    					
    					IF(FIND_STRING(cARTIST,'&amp;',1))
    						STRING_REPLACE(cARTIST,'&amp;','&');
    					
    					IF(nXM_MAP[nCHANNEL])
    					{
    						XM_CHNL[nXM_MAP[nCHANNEL]].CUR_ARTIST = cARTIST;
    						XM_CHNL[nXM_MAP[nCHANNEL]].CUR_SONG = "'"',cSONG,'"'";
    					}
    				}
    			}
    			fnXM_UPDATE(0);
    			cXM_BUFFER2 = ''
    		}
    	}
    }
    

    Getting information from here: http://www.xmradio.com/padData/pad_provider.jsp?all_channels=true
    Example information for a channel:
    <event> 
    		<artist>Oasis</artist> 
    		<album>Definitely Maybe</album> 
    		<songtitle>Live Forever</songtitle>  
    		<channelnumber>54</channelnumber> 
    		<channelname>Lithium</channelname> 
    		<trackId>25162043</trackId> 
    		<albumId>12937948</albumId> 
    		<artistId>10431522</artistId> 
    		<linkURL>http://home.napster.com/ns/purchase/clear/?type=track&amp;affiliate_id=14&amp;referral_id=XMRO&amp;COUNTRYCODE=US&amp;ids=25162043</linkURL> 
      </event> 
    

    Parse accordingly. Have fun!
  • Looks fun, thanks for your FB!
  • Wow! JJ, very cool, thanks for sharing! Do you recall how you came across that? I asked XM a long time ago if this info was even available over the net and they said no. :( Is there a "now playing" page on their website? (I don't see it)

    - Chip
  • AMXJeffAMXJeff Posts: 450
    Chip Moody wrote: »
    Wow! JJ, very cool, thanks for sharing! Do you recall how you came across that? I asked XM a long time ago if this info was even available over the net and they said no. :( Is there a "now playing" page on their website? (I don't see it)

    - Chip

    // specific channel
    http://www.xmradio.com/padData/pad_provider.jsp?channel=7

    // all channels
    http://www.xmradio.com/padData/pad_provider.jsp?all_channels=true
Sign In or Register to comment.