cloudy

Author Topic: Volcano Conditions PHP Script  (Read 7993 times)

0 Members and 1 Guest are viewing this topic.

Offline Silversword

  • --Stan Y.
  • Posts: 775
  • Maui, Hawaii
    • Up Country Maui Weather
Re: Volcano Conditions PHP Script
« Reply #15 on: June 29, 2009, 03:35:46 PM »
Hi again,

Took a look at the volcano-current-hi.txt file on the host server and got the attached file. Guess that something is still amiss that the script may not point to it..Will check on that later this evening when I get back home.

--Stan Y.
   Maui, Hawaii
WD 10.37r Bld 00
WDL 6.05

Dell Optiplex GX280-Intel Pentium 4 CPU 3.00GHz, 4 GB RAM
Webcam: Panasonic BL-C1A

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: Volcano Conditions PHP Script
« Reply #16 on: June 29, 2009, 03:45:36 PM »
It needed changes to the preg_match
I have it working.

I have attached a copy. Also release a new 1.01 zip that includes it.
« Last Edit: June 29, 2009, 04:16:05 PM by MCHALLIS »

Offline Silversword

  • --Stan Y.
  • Posts: 775
  • Maui, Hawaii
    • Up Country Maui Weather
Re: Volcano Conditions PHP Script
« Reply #17 on: June 29, 2009, 08:03:03 PM »
Hi Mike,

Thank you for the update and editing the script.

Got it working at www.dwayneyamato.com/wx/wxvolcano-hi.php.

There is another active site on the same mountain, Mauna Loa, called Puu O'O vent.  I wonder if I should try to make another page for it also.  If time permits, I will try that too.

Again thanks for your support for this project.

--Stan Y.
   Maui, Hawaii
WD 10.37r Bld 00
WDL 6.05

Dell Optiplex GX280-Intel Pentium 4 CPU 3.00GHz, 4 GB RAM
Webcam: Panasonic BL-C1A

Offline jjmcnelly

  • Posts: 263
  • Napavine, WA
    • Cedar Ridge Weather Station, Napavine WA 98565
Re: Volcano Conditions PHP Script *Updated*
« Reply #18 on: October 12, 2009, 04:00:26 AM »
For some reason it says the report is not available....

http://www.napavineweather.info/wxvolcano-wa.php

James

Update:  Here is a copy of the current cache file attached
« Last Edit: October 13, 2009, 02:13:58 AM by jjmcnelly »

Offline ALITTLEweird1

  • Mark
  • Posts: 3,867
  • Snoqualmie,WA
    • Snoqualmie Weather
Re: Volcano Conditions PHP Script
« Reply #19 on: October 12, 2009, 04:21:14 PM »
mine is saying the samething. It looks like its a problem at the USGS.
"Nature can do without man, but man cannot do without nature."

Davis VP2 + 1-Wire Solar + 1-wire Lightning + 1-Wire UV + Logitech Webcam

Offline jjmcnelly

  • Posts: 263
  • Napavine, WA
    • Cedar Ridge Weather Station, Napavine WA 98565
Re: Volcano Conditions PHP Script *updated*
« Reply #20 on: October 13, 2009, 02:18:18 AM »
added attachment FYI

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: Volcano Conditions PHP Script
« Reply #21 on: October 13, 2009, 04:30:57 AM »
They changed their HTML a bit. I have the fix:

Change:

Code: [Select]
   preg_match('|<strong>CASCADES VOLCANO OBSERVATORY(.*)changes in alert level as warranted.|Us', $volcanodata, $betweenspan);

   $string .= $betweenspan[1];

    if ($string == '') {
           $string  = 'Mount St. Helens Volcano Update unavailable, please try later.';
    } else {
           $string = "<strong>CASCADES VOLCANO OBSERVATORY$string"."changes in alert level as warranted<br /><br />";
    }

   $string = str_replace('/Back to top/', '', $string);
   $string = preg_replace("|<br />\r\n<br />\r\n<br />\r\n<br />\r\n|Us", '<br />', $string);

   $string= strip_tags($string, '<p><h3><br><strong>');

to:
Code: [Select]
   preg_match('|<b>CASCADES VOLCANO OBSERVATORY WEEKLY UPDATE</b>(.*)</cascade_update>|Us', $volcanodata, $betweenspan);

   $string .= $betweenspan[1];

    if ($string == '') {
           $string  = 'Mount St. Helens Volcano Update unavailable, please try later.';
    } else {
           $string = "<b>CASCADES VOLCANO OBSERVATORY</b><br />$string<br /><br />";
    }

   $string = strip_tags($string, '<b><br>');


Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: Volcano Conditions PHP Script
« Reply #22 on: October 13, 2009, 04:34:59 AM »
Version: 1.02 - 12-Oct-2009 - wxvolcano-wa.php fix for missing conditions text after USGS changed their HTML.

Offline Silversword

  • --Stan Y.
  • Posts: 775
  • Maui, Hawaii
    • Up Country Maui Weather
Re: Volcano Conditions PHP Script
« Reply #23 on: October 13, 2009, 03:41:57 PM »
Hi All,

My Volcano page seems to be working okay for the moment without the code modifications.  Guess different areas do different things.

--Stan Y.
   Maui, Hawaii
WD 10.37r Bld 00
WDL 6.05

Dell Optiplex GX280-Intel Pentium 4 CPU 3.00GHz, 4 GB RAM
Webcam: Panasonic BL-C1A

Offline i_fiorentino

  • Posts: 1,350
  • 160 mls Carmignano (Po), Tuscany, Italy
    • Meteocarmignano.it
Re: Volcano Conditions PHP Script
« Reply #24 on: October 14, 2009, 11:45:31 AM »
Hi Mike,
could you add Stromboli and/or Etna in italy??
Thank you very much,

Alessandro

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: Volcano Conditions PHP Script
« Reply #25 on: October 14, 2009, 01:39:24 PM »
Hi Mike,
could you add Stromboli and/or Etna in italy??
Thank you very much,

Alessandro

Do you have a URL to those volcano information pages?

Offline i_fiorentino

  • Posts: 1,350
  • 160 mls Carmignano (Po), Tuscany, Italy
    • Meteocarmignano.it
Re: Volcano Conditions PHP Script
« Reply #26 on: October 14, 2009, 03:29:12 PM »
Hi Mike,
what kind of information do you need to?
If you need to have general information it's here: http://www.ct.ingv.it/Default.asp
If not, please reply to this post.
Thanks again,

Alessandro

Offline niko

  • syzygy
  • Global Moderator
  • Posts: 21,998
  • Crystal Ball broken! Please post the URL.
  • Northern California, U.S.A.
    • http://www.realweatherstation.com
Re: Volcano Conditions PHP Script
« Reply #27 on: October 14, 2009, 03:44:37 PM »
Alessandro

Mike needs a link to a page like this one for the US that gives links to updated current information about the volcanoes.

Offline i_fiorentino

  • Posts: 1,350
  • 160 mls Carmignano (Po), Tuscany, Italy
    • Meteocarmignano.it
Re: Volcano Conditions PHP Script
« Reply #28 on: October 14, 2009, 05:23:19 PM »
I knew.
Unfortunately it doesn't exist in italy a similar resource.
Best regards,

Alessandro

Offline lddaly

  • Plano, Texas - USA
  • Posts: 108
  • Plano, TX - USA
    • Plano, TX Weather
Re: Volcano Conditions PHP Script
« Reply #29 on: April 07, 2010, 03:35:46 AM »
If you are using the wxvolcano-ak.php page, your RSS URL may be out of date. The following change worked for me:
Code: [Select]
$RSS_URL = 'http://www.avo.alaska.edu/release.php';

 

cumulus