Search code examples
htmliphonexcodeinternet-radio

How can I get a HTML element in Xcode?


I have a problem which I can't resolve.

Here it is:
I am trying to make a radio app for iPhone. I am using an online stream, so I want to display the current song in a label.
How to do that?
Here is the list with the songs for the day and the current song: http://live.radioeuphoria.bg:41232/played.html?sid=1.

So, how to get the HTML element that says which is the current song?
How to do that in Xcode?


Solution

  • You can use NSURLConnection to get the html as a string. Then use NSXMLParser to get the tags and values.

    NSURLConnection: https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSURLConnection_Class/Reference/Reference.html

    NSXMLParser: https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSXMLParser_Class/Reference/Reference.html