Tunein Radio

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

Moderator: Gurus

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

Tunein Radio

Post by fizzjob » Tue Mar 04, 2014 4:16 pm

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: 220
Joined: Sun Nov 08, 2009 4:36 pm
Contact:

Re: Tunein Radio

Post by Dan33185 » Fri May 30, 2014 9:11 pm

Any update on this? Would love something like this for MM

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

Re: Tunein Radio

Post by fizzjob » Sat May 31, 2014 9:43 am

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: 12095
Joined: Tue Jun 10, 2003 7:21 pm
Location: Serbia
Contact:

Re: Tunein Radio

Post by Peke » Sat May 31, 2014 7:44 pm

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,
Pavle
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
How to add SCREENSHOTS to forum

Post Reply