Well I’ve got to say that I absolutely love the PHP weather thing that I’ve got running on the index page now. I could maybe tidy up how it appears, and there are all sorts of fancy graphical devices that could be used, but in the short term, this scripting does something I’ve wanted to do from ages.
Basically I found a script that pulls content from a webpage. I used the simplified text only version of the BBC’s weather page for London. The basic script only pulled a section of text based on a start and end search expression, which was a little to simplified for me, but it gave me the intelligence to go further.
I wrote a bit of code to parse the returned data, and then reformat it into a simple table structure. Of course at the moment, it does rebuild every time I refresh the page, but I’m sure that the BBC can cope.
As I say, a collection of graphics corresponding to the words that the BBC use to standardly describe the weather would be next, with the correct graphics appearing correspondingly. I’d also ideally lose the Fahrenheit values and I’m a metric man where temperatures are concerned.
Somehow I never managed to get an off-the-shelf script to do all this for me before, so I’m pleased that I’ve managed to learn enough about how you use PHP to do what I have. Plenty more to be learnt however!
