repeat text extraction from html

Dell / OPTIPLEX GX520
April 2, 2009 at 01:10:14
Specs: Microsoft Windows XP Professional, 2.793 GHz / 1014 MB
Dear all,

I regularly listen to a radiostation via their live stream. They also have a playlist and show the title which is playing on their website. But this informatio is not streamed.

What I want:
1. A simple way to extract the line where the song is displayed which is playing. The text can be find between html tags <..> Songtitle </..>.
2. A way to display the extracted song title on the screen (via OSD or a taskbaar popup or something like this)

Any ideas?

Many thanks in advance.

The truth is out there... I want to believe


See More: repeat text extraction from html

Report •


#1
April 2, 2009 at 02:01:17
post a link to the page


=====================================
If at first you don't succeed, you're about average.

M2


Report •

#2
April 2, 2009 at 03:37:30
Link

de songtitle appears in red color after "Musik - Titelanzeige aktuell"

in the html-source:

<strong style="color: rgb(204, 0, 0);">12.34 Uhr +++ Underworld - Beautiful burnout +++</strong>
 

The truth is out there... I want to believe


Report •

#3
April 2, 2009 at 07:18:47
I worked on it for quite a while. Their page doesn't seem consistent enough to process with a script.


=====================================
If at first you don't succeed, you're about average.

M2


Report •

Related Solutions

#4
April 7, 2009 at 02:48:11
Sorry for the late reply but I couldn't leave a post from my computer at home...

Anyway many thanks for your help!

It is live radio, so there is quite some talking between the music. Then the song title will be empty (so the html tag). As they play a new song the page will be updated.

Any suggestions?

The truth is out there... I want to believe


Report •

#5
April 7, 2009 at 03:30:14
Get wget here:

http://golden-triangle.com/WGET.ZIP

And try this script:

===================
@echo off & setLocal EnableDelayedExpansion

if exist playList.do del playList.do
wget http://radioeins.funtip.de/playList.do

for /f "tokens=2 delims=+++" %%a in ('find "+++" ^< playlist.do') do (
echo %%a
)


=====================================
If at first you don't succeed, you're about average.

M2


Report •

#6
April 7, 2009 at 05:26:16
Thanks.

That does the job (at least the first part).

How can I repeat that every say 30 seconds?

Are you aware of any little tool, that can display the string on my screen as a kind of pop up or OSD message?

The truth is out there... I want to believe


Report •

#7
April 8, 2009 at 06:08:00
Dunno about popup, but to loop:

@echo off & setLocal EnableDelayedExpansion
:loop
if exist playList.do del playList.do
wget http://radioeins.funtip.de/playList.do

for /f "tokens=2 delims=+++" %%a in ('find "+++" ^< playlist.do') do (
echo %%a
)
ping -n 1 -w 30000 192.168.0.0
goto :loop


=====================================
If at first you don't succeed, you're about average.

M2


Report •

#8
April 8, 2009 at 07:11:15
Thanks again,

One last question:
Is it possible to rename the command-window with the content of the variable (%%a) ?

The truth is out there... I want to believe


Report •

#9
April 8, 2009 at 07:34:14
I don't see how.


=====================================
If at first you don't succeed, you're about average.

M2


Report •


Ask Question