Search code examples
c#streamwebradio

Read current artist/song from webpage/webradio


First off: This is my first time trying to connect with a Webpage so if my questions are dumb but that's just how i feel now so it should be right. :D

I thought of just trying to read out a Artist/song from a Webradio as a slow start so i can use this to learn a bit about it all.

I Chose http://www.planetradio.de/ as Radio source. Note that i don't want the song played as well. Just the current song displayed in a string....but all i find as Code are suggestions how to read the songname when the song is played as well...

If someone could give me a hint or a bit of help to get me started i'd really appreciate it. :)

Thanks in advance to everyone


Solution

  • You can use the WebClient class. You can see some examples here.

    Basically what you need to do is download the HTML of the page in a string with the WebClient.DownloadString Method. Once you have the HTML string, it will be easy to get the tags you want.

    There are different approach to obtain what you are looking for, but I think the simplest is this one.