PDA

View Full Version : Putting web site text into a live window


rob_frost
13th Sep 2002, 16:05
What I would like to do is take a number ( the wind strength) off a local website, and put it in an updating window on my PC desktop.

The network has a weather system, that updates about every ten seconds, producing a line like this

Wind North-Easterly, 9 km/hr, temperature 23.2, Pressure 1026mb and falling very slowly

I would like to take the 9, from the 9 km/hr, every ten seconds and display it on my desktop somehow. The line above can be accessed as a website, or saved as a text file to my network directory. But for each of these, I either have to referesh the page continually, or for the file version, go to telnet, and type fetch bcast (bcast is the name of the file)

So is there some way to get a continually updating one?

Thanks for any help

Rob

???pax
13th Sep 2002, 16:54
Not very straight forward this. Any application needs to connect to the URL and then be capable of parsing(tokenizing) the HTML coming back in the HTTP response in order to extract the information you are after. It then has to display the desired information in some format.

As a Java man this is not at all difficult to do .
Perhaps some VB/C#ers would like to offer an alternative solution.

Nightrider
13th Sep 2002, 22:51
Rob...also I can understand the idea of your wishes...but you are not really asking here for help to hack a website, this is what you are intending to do, aren't you????

rob_frost
14th Sep 2002, 13:22
No I'm not. I had no idea you would even go about it like this.

The web page I want to copy a bit off is here (http://www.felsted.essex.sch.uk/bcast)

I want to know the local wind so I can see when it is worth flying my kite. Looking out of the window is not very helpful because the wind varies quite a bit from where I would look to where I could fly a kite. A window showing the updated wind would be useful.

Does that satisfy you? If I wanted to know how to hack a website, I would never do it through my real name so obviously... I could get traced very very quickly..

Nightrider
14th Sep 2002, 16:30
Rob...don't be upset...according to UK law, and there are others who may confirm that this is not only the law here, "hijacking" data from another website is already hacking...

You may, however, ask the school to allow you to access their wind-data...they may tell you how to address the location of these data on their database und you can than easily integrate these values on your website.

rob_frost
14th Sep 2002, 16:40
Its ok:) I have asked about it, and they have no problems.

Is there any way i can get get a browser to refresh every 10 seconds? This seems simpler ( but less effective) than putting the original file into a new website of my own.
Or is it only possible to chose the refresh rate if you are the page editor, not the viewer?

GoneWest
15th Sep 2002, 00:23
Makes me think back to my earlier days of "Basic"

10 CLR
20 PRINT "WIND SPEED = 10"
30 GOTO 10

Used to tap similar into my Sinclair ZX81 computer - had an on board memory of 1Kb - fantastic stuff (who on Earth could ever write a programme big enough to use a full kilobyte??)

Nightrider
15th Sep 2002, 01:41
I had a look at the site. The way it is written, the website refreshes at a given rate set with a METATAG. This you cannot change.
However, everytime you hit the refresh button on your browser you will see the latest read out from their unit, it appears to be a constant dataflow as you can refresh in less than 2 seconds and you have a change in the reading.
Due to this I doubt that they store the data in a database as this would create a huge one within a very short time.

If they are so friendly to allow you to copy their data to your website, why not approach them again and ask the one who programmed the site...he can give you the exact code for that particular element you want, also I doubt he will allow you access "behind" the doors as this will open their server and make it vulnerable to attacks...
Perhaps you see now why I tried to warn you about this idea.

rob_frost
16th Sep 2002, 20:45
Yeah, I see what you mean, but I'm pretty sure they wouldn't give me anything I could do any damage with:)

The annoying thing is it can be done very easily on a BBC, but on a wonderful super fast PC, you need to do all sorts of things I have no idea about.

The refresh button will have to do i think.