Tunein Radio

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

Moderators: Gurus, Addon Administrators

fizzjob
Posts: 417
Joined: Fri Mar 30, 2007 12:37 pm

Tunein Radio

Post by fizzjob »

So I figured I'd take a crack at hacking together a Tunein Radio script - everything seems to be based on xml files (http://opml.radiotime.com/), but I'm having a hard time parsing them.

Here's what I've got so far - all it does is create a node in Net Radio, but I can't figure out how to populate the subnodes. Parsing XML just seems to elude me.

Code: Select all

Dim objXMLDoc
Dim NodeList 
Dim Node 
Dim ChildNode 
Dim NodeAttr 

Sub OnStartup
  Set Tree = SDB.MainTree
 
  Set Node = Tree.CreateNode
  Node.Caption = "Tunein Radio"
  Node.IconIndex = 56
  Node.UseScript = Script.ScriptPath
  Node.OnFillChildren = "FillGenres"
 
  Tree.AddNode Tree.Node_Radio, Node, 3     ' Insert after the node
  Node.HasChildren = True
End Sub

Sub FillGenres
	Set objXMLDoc = CreateObject("Microsoft.XMLDOM") 
	objXMLDoc.async = False 
	objXMLDoc.load("http://opml.radiotime.com")

	set Node = objXMLDoc.getElementsByTagName("outline")
	if Node.length > 0 then
		For each x in Node
			Set NewNode = Tree.CreateNode
			NewNode.Caption = x.getattribute("text")
			NewNode.IconIndex = 0
			Tree.AddNode Node, NewNode, 3
		next
	end if
End Sub
When I run this code with wscript, I get the "text" attributes, but I'm having a hard time getting it into MM.

Code: Select all

Dim objXMLDoc
Dim NodeList 
Dim Node 
Dim ChildNode 
Dim NodeAttr 

Set objXMLDoc = CreateObject("Microsoft.XMLDOM") 
objXMLDoc.async = False 
objXMLDoc.load("http://opml.radiotime.com")

set Node = objXMLDoc.getElementsByTagName("outline")
if Node.length > 0 then
	For each x in Node
		ChildNode = x.getattribute("text")
		WScript.echo ChildNode
	next
end if
Image
Dan33185
Posts: 233
Joined: Sun Nov 08, 2009 4:36 pm

Re: Tunein Radio

Post by Dan33185 »

Any update on this? Would love something like this for MM
fizzjob
Posts: 417
Joined: Fri Mar 30, 2007 12:37 pm

Re: Tunein Radio

Post by fizzjob »

Nope. After a while, the XML files were coming up blank (even in my browser). I never could figure it out, although I figured that they were probably blocking my IP address.
Image
Peke
Posts: 17486
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: Tunein Radio

Post by Peke »

On their site it is clearly stated that large number of requests could end in IP Ban.

I would suggest that you save XML locally and add Manual Refresh in Context menu.
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
Post Reply