cloudy

Author Topic: PHP Extraction of WD Avg/Ext HTM Files  (Read 43058 times)

0 Members and 2 Guests are viewing this topic.

Offline Alexb

  • Posts: 9
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #105 on: January 07, 2008, 10:38:53 AM »
i translate the script in italian http://www.folignometeo.net/foligno/sample.php but there is a  little problem with the day numbers... it's always 0  :roll: :roll: :roll:

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #106 on: January 07, 2008, 03:26:22 PM »
Alexb

In AvgExtract.php
The line that was
Code: [Select]
preg_match("/Extremes for day :(\d{1,2})\</",$value,$found);
What did you change it to? Or did you not change it?
« Last Edit: January 07, 2008, 07:14:05 PM by MCHALLIS »

Offline Alexb

  • Posts: 9
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #107 on: January 07, 2008, 06:24:53 PM »
I'm not change nothing here the code:

Code: [Select]
preg_match("/Medie \ estremi per il giorno:(\d{1,2})\</",$value,$found);
                    $DAY = $found[1]

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #108 on: January 07, 2008, 07:35:16 PM »
Alexb

There were two errors in your preg_match
the slash was not properly escaped and there was not a space after the colon

Change it to this ...

Code: [Select]
preg_match("/Medie \\\ estremi per il giorno: (\d{1,2})\</",$value,$found);

Offline Alexb

  • Posts: 9
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #109 on: January 08, 2008, 01:01:02 PM »
Thanks MCHALLIS,  now works very well, http://www.folignometeo.net/foligno/sample.php

Only the rain day at the end of page don't appers.

Offline jwwd

  • Posts: 3,545
  • Silkeborg, Denmark (56:10:58 N-09:30:26 E) - Elevation 75,35 meters
    • Weather at Silkeborg, Denmark
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #110 on: February 21, 2008, 11:47:39 AM »
Hi

I can see that Brian has updated the av/ext .html file - here is what he writes on the www.weather-display.com history page:

20th Feb 10.37i build 9 .zip update: Added daily rain for each day to the av/ext .html, and the month rain total now adds up when recreating that

Would above have any influence to the script?

Best regards,

Henrik

Offline TNETWeather

  • Kevin Reed (KrelvinAZ)
  • Global Moderator
  • Posts: 5,859
  • Gremlins are at work...
  • Mesa, AZ
    • TNET Weather Station - Mesa AZ
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #111 on: February 23, 2008, 03:19:56 AM »
I would guess that it has no effect on the script since the script looks for the information if it is there or not.  Having it there all the time simply means it would find it each time.

All you need is Time, Aptitude and Desire ... and you can build just about anything...

Offline jwwd

  • Posts: 3,545
  • Silkeborg, Denmark (56:10:58 N-09:30:26 E) - Elevation 75,35 meters
    • Weather at Silkeborg, Denmark
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #112 on: February 23, 2008, 07:22:21 AM »
Hi Kevin

Thanks for your reply.

I will have a go for it.

Best regards,

Henrik

Offline Gert

  • Posts: 93
    • Toppen Weather - Denmark
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #113 on: March 13, 2008, 12:42:56 PM »
Hi

Anyone tried to incoporate this script into Ken True's templates, so it can be called from menu and be using the CSS already defined. Maybe it is easy, but I'm not a guru with PHP and CSS.

Thanks

Rgds
Gert

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #114 on: March 13, 2008, 02:39:22 PM »
Hi

Anyone tried to incorporate this script into Ken True's templates, so it can be called from menu and be using the CSS already defined. Maybe it is easy, but I'm not a guru with PHP and CSS.

Thanks

Rgds
Gert

Gert,

I have this script running in a  Ken True template:
http://www.carmosaic.com/weather/monthly-stats.php

I can work on integrating the style into my color theme switcher maybe Saturday or Sunday. I will be too busy today and tomorrow.
What I will do is make the style compatible, then make a sample page for the new templates and zip it up and send it to Ken to add to the distro.
« Last Edit: March 13, 2008, 03:25:46 PM by MCHALLIS »

Offline Gert

  • Posts: 93
    • Toppen Weather - Denmark
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #115 on: March 13, 2008, 03:20:55 PM »
Hi Mike

That sounds really good. Looking forward to try it out.

Thanks

Rgds
Gert

Offline Ewan

  • Posts: 74
  • Notts, UK
    • TheWeatherToday
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #116 on: March 14, 2008, 01:26:40 PM »
I've implemented this script on my site but it isn't showing the degree symbol correctly:

http://www.theweathertoday.co.uk/avgext.php

They look OK when I use the sample script:

http://www.theweathertoday.co.uk/avgtest.php

so I thought it was a CSS thing.  However, when I remove CSS completely, they still display incorrectly:

http://www.theweathertoday.co.uk/avgext-no-css.php

Can anyone explain this?

Thanks.

Online jmcmurry

  • Jim McMurry
  • Posts: 2,213
  • Mauston, WI, USA
    • Juneau County Weather
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #117 on: March 14, 2008, 02:04:47 PM »
Lets try changing this

<meta http-equiv="content-type" content="text/html; charset=utf-8" />

to what's in the example and see how that works.

- Jim

 Home of NSLog NexStorm Lightning Data Manager

Offline Ewan

  • Posts: 74
  • Notts, UK
    • TheWeatherToday
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #118 on: March 14, 2008, 03:44:57 PM »
That did it, thanks!

It's strange though, because the rest of the site uses the same character set and all those pages display the symbol correctly.  :roll:

It's great that there are people here who know what they're talking about to help those of us who blindly hack, slash, cut and paste bits of code into pages without knowing what half of it does ;)

Thanks again.

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #119 on: March 15, 2008, 04:05:05 AM »
What do you think of this?
http://www.carmosaic.com/weather/monthly-stats.php

Try out the toggle 24 Hour Chart daily image feature (the image links are at the bottom of each daily table)

I have modified and repackaged AvgExtract.php into include-wxhistory.php
I am sending two files (wxhistory.php and include-wxhistory.php) to Ken to be used as a plugin for use in
the Weather Display/PHP/AJAX Website Template Set

Features / Changes:
Modified for style compatibility with my css theme switcher and to be used
inside of a wxhistory.php page in a Weather Display/PHP/AJAX Website Template set

Added if is_file check and toggle image feature for 24 hour chart images
also added other minor formatting changes like


This version of AvgExtract.php I have developed into include-wxhistory.php
At this time, is only designed to be used as a plugin for use in
the Weather Display/PHP/AJAX Website Template Set because it has css style changes inside include-wxhistory.php.
include-wxhistory.php should not be used outside of the Weather Display/PHP/AJAX Website Template Set or it will not work right.


« Last Edit: March 15, 2008, 02:56:37 PM by MCHALLIS »

 

cumulus