Author Topic: NOAA Image of the Day source changed...  (Read 25358 times)

0 Members and 1 Guest are viewing this topic.

Offline up10ad N9RJH

  • USA Weather Finder
  • WxElement panel
  • Forecaster
  • *****
  • Posts: 578
  • Station will be back up someday...
    • Forecaster without a site
NOAA Image of the Day source changed...
« on: August 05, 2010, 12:08:08 PM »
It looks like the NOAA Image of the Day is now handled by the Envoronmental Visualization Lab at NOAA, and the images seem to be individually time and date stamped.  This makes downloading them a bit nasty and I haven't figured out a way to do it yet. 

According to the OSEI website:

Quote
The last image to update this site will be generated on July 31, 2010. Beginning August 1, 2010, the image of the day will be generated by the NOAA Environmental Visualization Laboratory (ENL) and placed on their site. The OSEI site will remain available to locate imagery generated prior to August 1, 2010.

Anyone have any good ideas to keep the IOD alive on our sites?   :-(
Rick (N9RJH)
Have you joined USAWeatherFinder.com yet?

Offline SoMDWx

  • Forecaster
  • *****
  • Posts: 1015
    • Southern Maryland Weather
Re: NOAA Image of the Day source changed...
« Reply #1 on: August 05, 2010, 12:34:15 PM »
Rick ,
  Where on their site are you looking? Which image?

Jim

Offline DaculaWeather

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3206
    • North Georgia Weather
Re: NOAA Image of the Day source changed...
« Reply #2 on: August 05, 2010, 12:35:12 PM »
It's working on my site

Offline SoMDWx

  • Forecaster
  • *****
  • Posts: 1015
    • Southern Maryland Weather
Re: NOAA Image of the Day source changed...
« Reply #3 on: August 05, 2010, 12:36:48 PM »
Steve,
  It will still work for images PRIOR to 8/1/2010.. Any new images wil be hosted on the ENL site....

Offline DaculaWeather

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3206
    • North Georgia Weather
Re: NOAA Image of the Day source changed...
« Reply #4 on: August 05, 2010, 12:42:27 PM »
Ahhhh, I didn't see that part!

Offline SoMDWx

  • Forecaster
  • *****
  • Posts: 1015
    • Southern Maryland Weather
Re: NOAA Image of the Day source changed...
« Reply #5 on: August 05, 2010, 01:16:03 PM »
Rick,
  See if this is the image you want:

http://somdweather.com/iod.php

Jim

Offline up10ad N9RJH

  • USA Weather Finder
  • WxElement panel
  • Forecaster
  • *****
  • Posts: 578
  • Station will be back up someday...
    • Forecaster without a site
Re: NOAA Image of the Day source changed...
« Reply #6 on: August 05, 2010, 05:54:05 PM »
Rick,
  See if this is the image you want:

http://somdweather.com/iod.php

Jim
Yup, that's the image, but the name will change with every new image posted: .../471_Aug02-Frame-NoDate.jpg
Rick (N9RJH)
Have you joined USAWeatherFinder.com yet?

Offline SoMDWx

  • Forecaster
  • *****
  • Posts: 1015
    • Southern Maryland Weather
Re: NOAA Image of the Day source changed...
« Reply #7 on: August 05, 2010, 06:02:24 PM »
Yes it will but I don't look at that.. This PHP file takes care of the naming problem.....

Jim

Offline up10ad N9RJH

  • USA Weather Finder
  • WxElement panel
  • Forecaster
  • *****
  • Posts: 578
  • Station will be back up someday...
    • Forecaster without a site
Re: NOAA Image of the Day source changed...
« Reply #8 on: August 05, 2010, 06:29:44 PM »
Jim,

I'm not following what php file manages and takes care of renaming it.  The only one I have ever seen is the one on Ken's Satatoga Weather, and it still references the old URL for getting the image. 
Rick (N9RJH)
Have you joined USAWeatherFinder.com yet?

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: NOAA Image of the Day source changed...
« Reply #9 on: August 05, 2010, 09:14:34 PM »
I'm working on a new version of the NOAA-IOD script now...
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline SoMDWx

  • Forecaster
  • *****
  • Posts: 1015
    • Southern Maryland Weather
Re: NOAA Image of the Day source changed...
« Reply #10 on: August 05, 2010, 09:27:58 PM »
Here you go:

      <?php

      $image_name = "";

      $html = implode('', file("http://www.nnvl.noaa.gov/MediaHome.php?MediaTypeID=1"));

      preg_match_all("|MediaDetail.php(.*)Featured Image|Uis", $html, $headers);

      $text = $headers[0];
      
      $spot = strpos($text[0],"src");

      $image_name = substr($text[0],$spot+4);

      $spot = strpos($image_name,"/>");
   
      $image_name = substr($image_name,1,$spot+1);

      //echo $image_name;

      $image_name = "http://www.nnvl.noaa.gov/" . $image_name;

      echo "<img width='700px' height='490px' src='" . $image_name;


?>


Jim
Jim,

I'm not following what php file manages and takes care of renaming it.  The only one I have ever seen is the one on Ken's Satatoga Weather, and it still references the old URL for getting the image. 

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: NOAA Image of the Day source changed...
« Reply #11 on: August 07, 2010, 01:54:28 AM »
I've got a replacement for the IOD resize script.. it's a bit more complicated script (uses three cache files, one for HTML and two for images), but is easy to implement.

   Where you want the output on your page, just put
Code: [Select]
<?php include_once("get-nnvl-iod.php"); ?>
I've not updated the scripts section yet, but you can download the source directly from

http://saratoga-weather.org/get-nnvl-iod.php?sce=view

Example of operation:  http://saratoga-weather.org/NOAA-IOD.php

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline DaculaWeather

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3206
    • North Georgia Weather
Re: NOAA Image of the Day source changed...
« Reply #12 on: August 07, 2010, 10:14:07 AM »
Added!! works great Ken, genius!

Offline spweather

  • Contributor
  • ***
  • Posts: 130
    • Sand Point Weather
Re: NOAA Image of the Day source changed...
« Reply #13 on: August 07, 2010, 10:54:41 AM »
Thanks Ken,

Main page is working great, however the link to the high resolution image loads Error 404 page.

Dennis
« Last Edit: August 07, 2010, 10:58:00 AM by spweather »
Regards,
Dennis

- Davis Wireless Vantage Pro2 Plus w/24hr FARS
- Davis (Ultra)Sonic Anemometer
- Boltek/MicroLDN TOA Lightening Detection
- Porcupine Labs LR4/Fluke 414D Laser Rangefinder snow depth measuring sensor


Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: NOAA Image of the Day source changed...
« Reply #14 on: August 07, 2010, 12:47:18 PM »
Oops... thanks for spotting that.  I've fixed the hi-res image link in V1.01 of the script.

Now the scripts page is updated http://saratoga-weather.org/scripts-images.php#NOAAIOD too :)

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline up10ad N9RJH

  • USA Weather Finder
  • WxElement panel
  • Forecaster
  • *****
  • Posts: 578
  • Station will be back up someday...
    • Forecaster without a site
Re: NOAA Image of the Day source changed...
« Reply #15 on: August 07, 2010, 01:29:32 PM »
Great update Ken, thanks.  I started a modification myself, but you are leagues ahead of me in coding; I appreciate your efforts.
Rick (N9RJH)
Have you joined USAWeatherFinder.com yet?

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: NOAA Image of the Day source changed...
« Reply #16 on: August 07, 2010, 01:38:45 PM »
Hi Rick,

The old IOD site had all the info, including the description, in the image graphic itself.. the new site had a separate text entry to describe the image, so the new script has to have a lot more fetch/parse/cache than the old single-image script did.  Hey, the old one was good for 4 years of operation, which is not bad :)

I'm just glad that NOAA is fairly slow in doing major updates to things, so page-scraper scripts like this don't have to change very often...

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline DaculaWeather

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3206
    • North Georgia Weather
Re: NOAA Image of the Day source changed...
« Reply #17 on: August 07, 2010, 01:56:06 PM »
I'll bet you do!!  :grin:
Here's mine: http://www.daculaweather.com/iod.php

Thanks for everything Ken!

Offline SoMDWx

  • Forecaster
  • *****
  • Posts: 1015
    • Southern Maryland Weather
Re: NOAA Image of the Day source changed...
« Reply #18 on: August 08, 2010, 03:45:35 PM »
Wow, did i just miss something????

Offline DaculaWeather

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3206
    • North Georgia Weather
Re: NOAA Image of the Day source changed...
« Reply #19 on: August 08, 2010, 03:47:01 PM »
Don't feel bad, I missed it too until someone mentioned it.  :roll: But Ken did a GREAT job on this one, much more detail than just a picture.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: NOAA Image of the Day source changed...
« Reply #20 on: August 09, 2010, 04:08:26 PM »
Ahh... you have one main issue: your PHP doesn't allow (currently) an fopen to an URL.  To fix, put a php.ini file in the same directory as the script and put in it:

allow_url_fopen = on;

That should allow the image file to be fetched, saved and resized.

Best regards,
Ken

Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: NOAA Image of the Day source changed...
« Reply #21 on: August 09, 2010, 05:57:36 PM »
Just did an update to the script to V1.02.
Added UTF-8 to ISO-8859-1 character set conversion
Updated logic to parse the NNVL page as they seem to have a couple of internal formats

http://saratoga-weather.org/scripts-images.php#NOAAIOD

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline DaculaWeather

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3206
    • North Georgia Weather
Re: NOAA Image of the Day source changed...
« Reply #22 on: August 09, 2010, 06:03:30 PM »
Thanks Ken, just updated mine. But I have a question, Where is says Nina with the tilde, mine shows a black square box with with a question mark inside http://www.daculaweather.com/iod.php

That was in Chrome, checking IE8 and Firefox in a minute.

Square box in IE8
« Last Edit: August 09, 2010, 06:10:12 PM by DaculaWeather »

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: NOAA Image of the Day source changed...
« Reply #23 on: August 09, 2010, 06:12:37 PM »
After updating the script, you should run get-nnvl-iod.php?cache=refresh to reload the cache file for the HTML to include the headers, then the black box/other artifacts should disappear.

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline DaculaWeather

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3206
    • North Georgia Weather
Re: NOAA Image of the Day source changed...
« Reply #24 on: August 09, 2010, 06:42:13 PM »
Thank you Ken. That worked.

 

anything