Author Topic: Updated advforecast2.php (JSON) V5.11 handles NWS API change  (Read 1436 times)

0 Members and 1 Guest are viewing this topic.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Updated advforecast2.php (JSON) V5.11 handles NWS API change
« on: April 30, 2019, 02:37:47 PM »
With the announcement of the NWS on 29-Apr-2019 that the api.weather.gov was deprecating the forecast queries for points/ and removing the current 302 redirect to a gridpoint forecast, the underlying method of using the API had to change in the script.

Now, the specified point's meta-data is fetched first (from cache if available, otherwise fetched from API and cached) and the gridpoint forecast is used directly (based on the meta-data content).   The prior caching method (in ./cache/forecast-URLcache.txt) is no longer used (that had contained the point->gridpoint URLs). 

Now the ./cache/forecast-{zone}-{N}-json-meta.txt file contains all the relevant data about the specified point that was derived from multiple API fetches re: point, Zone, WFO and saved.

If you're using the V5.10 script, please update before 24-Jun-2019 when the NWS will turn off the 302 redirect for the point forecast and that version of the script will likely fail to work properly.

Standalone update: use the script page for download.
Saratoga Template(USA): use the update tool page with query Base-USA, Plugin-*, 30-Apr-2019
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 Andy G

  • Forecaster
  • *****
  • Posts: 306
    • SunPrairieWeather.com
Re: Updated advforecast2.php (JSON) V5.11 handles NWS API change
« Reply #1 on: April 30, 2019, 02:41:07 PM »
All over my head, but once again a big thank you Ken.
Once you can accept the universe as being something expanding into an infinite nothing which is something, wearing stripes with plaid is easy.
~Einstein


SunPrairieWeather.com
Davis VP2 24 FARS

Offline chief-david

  • Educational Weather
  • Forecaster
  • *****
  • Posts: 2845
  • Space Academy for Educators
    • Benilde-St. Margaret's Weather
Re: Updated advforecast2.php (JSON) V5.11 handles NWS API change
« Reply #2 on: April 30, 2019, 03:15:31 PM »
« Last Edit: April 30, 2019, 03:25:20 PM by chief-david »



You can't phase me-I teach Middle School.
It's not you-It's WU.

Offline floodcaster

  • Forecaster
  • *****
  • Posts: 635
    • Goose Lake Weather
Re: Updated advforecast2.php (JSON) V5.11 handles NWS API change
« Reply #3 on: April 30, 2019, 04:50:08 PM »
Thanks Ken.
Bill


Offline Otis

  • (aka Paul)
  • Forecaster
  • *****
  • Posts: 724
    • Lake Huron Weather
Re: Updated advforecast2.php (JSON) V5.11 handles NWS API change
« Reply #4 on: April 30, 2019, 05:17:33 PM »
Yep, thanks Ken.  [tup]

CW3699

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 947
    • LexMAWeather
Re: Updated advforecast2.php (JSON) V5.11 handles NWS API change
« Reply #5 on: April 30, 2019, 05:39:34 PM »
Thanks, Ken!

The hourly stuff is for future use if the comments are accurate.  :grin:  Want any of us to turn the fetch on just to make sure it all does what it's supposed to?
https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Updated advforecast2.php (JSON) V5.11 handles NWS API change
« Reply #6 on: April 30, 2019, 06:23:59 PM »
You're free to turn it on if you like (it will fetch/store the hourly data in a separate cache file).  I just haven't added the display code to the script.  Thought I'd do something like the tabbed display for daily/hourly that I do with the DarkSky script (DS-forecast.php), or maybe a meteogram-like display using HighCharts.  The data is in the API.. just thought it should be handled at some time.

The only cost to turning it on is one extra fetch of (fairly large) JSON from api.weather.gov which could add a couple of seconds to the page load time (since the page will wait while data is being fetched).
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: Updated advforecast2.php (JSON) V5.11 handles NWS API change
« Reply #7 on: April 30, 2019, 06:26:53 PM »
All over my head, but once again a big thank you Ken.
I can understand 9 words in that post. Billy Madison

https://getyarn.io/yarn-clip/embed/1d44f626-ae87-46fa-9174-f3e55d76dc18?autoplay=false
Sorry folks, I didn't mean to confuse -- just wanted to document the internal changes and 'why' so others (who may want to develop their own scripts) could see what the API changes might mean to their script's logic flow.  It does read a bit like a StackOverflow answer to a detailed question  :shock:  8-)
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 Jasiu

  • Forecaster
  • *****
  • Posts: 947
    • LexMAWeather
Re: Updated advforecast2.php (JSON) V5.11 handles NWS API change
« Reply #8 on: April 30, 2019, 06:33:26 PM »
The only cost to turning it on is one extra fetch of (fairly large) JSON from api.weather.gov which could add a couple of seconds to the page load time (since the page will wait while data is being fetched).

I pull the forecast in a cron job so that it doesn't affect the page load, so that's the only place I'll take the hit. I'll turn it on in my sandbox just to give it some airtime.
https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline chief-david

  • Educational Weather
  • Forecaster
  • *****
  • Posts: 2845
  • Space Academy for Educators
    • Benilde-St. Margaret's Weather
Re: Updated advforecast2.php (JSON) V5.11 handles NWS API change
« Reply #9 on: May 01, 2019, 09:47:12 AM »
All over my head, but once again a big thank you Ken.
I can understand 9 words in that post. Billy Madison

https://getyarn.io/yarn-clip/embed/1d44f626-ae87-46fa-9174-f3e55d76dc18?autoplay=false
Sorry folks, I didn't mean to confuse -- just wanted to document the internal changes and 'why' so others (who may want to develop their own scripts) could see what the API changes might mean to their script's logic flow.  It does read a bit like a StackOverflow answer to a detailed question  :shock:  8-)

I just take your word that all is good. Blindly follow.
It is on this page https://rms-weather.rdale.org/testpage/weather.php



You can't phase me-I teach Middle School.
It's not you-It's WU.

Offline Intheswamp

  • Early on one frosty morn'...
  • Forecaster
  • *****
  • Posts: 1485
  • Sure...I know enough to be dangerous, now.
    • Beeweather
Re: Updated advforecast2.php (JSON) V5.11 handles NWS API change
« Reply #10 on: May 01, 2019, 10:36:35 AM »
Thanks for the update, Ken.  I'd be lost without you!

Davis VP2, v3.12
Cumulus v1.9.4  Build 1079
Today's weather beats no weather at all!
www.beeweather.com
www.beausandbonnets.com

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 947
    • LexMAWeather
Re: Updated advforecast2.php (JSON) V5.11 handles NWS API change
« Reply #11 on: May 01, 2019, 10:47:57 AM »
Thought I'd do something like the tabbed display for daily/hourly that I do with the DarkSky script (DS-forecast.php), or maybe a meteogram-like display using HighCharts.  The data is in the API.. just thought it should be handled at some time.

Can you point me to implementation examples? I'm trying to envision this. Tabbing seems reasonable.

FWIW I find "hourly" granularity beyond 36 hours or so to be pretty useless (like 10-day forecasts). Good thing the NWS gives us 150+ hours.  :grin:
https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Updated advforecast2.php (JSON) V5.11 handles NWS API change
« Reply #12 on: May 01, 2019, 11:49:26 AM »
Sure, my DS-forecast demo page shows one method of tabbed display.  Script is here on the scripts page.

I don't have a sample of the intended meteogram graphs, but the version on the NWS beta forecast-v3.weather.gov site shows what might be done.
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 kc1fx

  • Member
  • *
  • Posts: 15
    • Local Weather
Re: Updated advforecast2.php (JSON) V5.11 handles NWS API change
« Reply #13 on: May 01, 2019, 07:44:57 PM »
I am having an issue with the NOAA-NWS 2nd page. When I click the link, I get:
 "{
    "@context": [
        "https://raw.githubusercontent.com/geojson/geojson-ld/master/contexts/geojson-base.jsonld",
        {
            "wx": "https://api.weather.gov/ontology#",
            "geo": "http://www.opengis.net/ont/geosparql#",
            "unit": "http://codes.wmo.int/common/unit/",
            "@vocab": "https://api.weather.gov/ontology#"
        }
    ],


and it goes down a ways, but you can read the forecast... The URL in the address bar is shown as : "https://api.weather.gov/gridpoints/GYX/22,77/forecast

Prior to this version, is was working fine.

Gary

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 947
    • LexMAWeather
Re: Updated advforecast2.php (JSON) V5.11 handles NWS API change
« Reply #14 on: May 01, 2019, 09:12:30 PM »
Yeah, that link should be of the form:

   https://forecast-v3.weather.gov/point/latitude,longitude

rather than the API gridpoints URL.

Should be an easy fix for Ken.
https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Updated advforecast2.php (JSON) V5.11 handles NWS API change
« Reply #15 on: May 01, 2019, 09:55:49 PM »
Ah.. my bad.  I've now updated to 5.12 with the corrected link to weather.gov pages for both point and zone forecasts.

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 ValentineWeather

  • Forecaster
  • *****
  • Posts: 6364
    • Valentine Nebraska's Real-Time Weather
Re: Updated advforecast2.php (JSON) V5.11 handles NWS API change
« Reply #16 on: May 02, 2019, 06:45:59 AM »
Thanks Ken... [tup]
Randy

Offline rrrick8

  • Senior Contributor
  • ****
  • Posts: 224
    • Vermilion weather
Re: Updated advforecast2.php (JSON) V5.11 handles NWS API change
« Reply #17 on: May 02, 2019, 09:44:42 AM »
Ah.. my bad.  I've now updated to 5.12 with the corrected link to weather.gov pages for both point and zone forecasts.

*Sigh*
Sorry, but must be feeling lazy today after spending 4 hours yesterday finding the appropriate lines for adapting the stand-alone page script layout to my preferences....
I know I'm in the minority by using a stand-alone page (that has background and other layout modifications) but if there is only a line or two of change it would be a lot easier to change the altered line(s) than replace the whole page and then have to go back and change many lines of layout code.
If that is the case, only a line or two change, would it be possible to just post the changed lines? They are usually easy to find by doing a "Search" for line(s) to be changed.
Severe Weather Manager-Vermilion County EMA
CWOP-CW9931 KILDANVI5

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Updated advforecast2.php (JSON) V5.11 handles NWS API change
« Reply #18 on: May 02, 2019, 10:41:06 AM »
Ah.. my bad.  I've now updated to 5.12 with the corrected link to weather.gov pages for both point and zone forecasts.

*Sigh*
Sorry, but must be feeling lazy today after spending 4 hours yesterday finding the appropriate lines for adapting the stand-alone page script layout to my preferences....
I know I'm in the minority by using a stand-alone page (that has background and other layout modifications) but if there is only a line or two of change it would be a lot easier to change the altered line(s) than replace the whole page and then have to go back and change many lines of layout code.
If that is the case, only a line or two change, would it be possible to just post the changed lines? They are usually easy to find by doing a "Search" for line(s) to be changed.
I feel your pain.  Nevertheless, we should be grateful to Ken for all of the fantastic things he does for us.  Sure, there were only four lines changed from V5.11 to V5.12, but with a file comparison program they were easy to spot.  I use CompareIt! to identify and incorporate the changes into my significantly modified advforecast2.php so that my preferred large-icon presentation is preserved.  I know where the changes I've made reside so I can safely bypass them during the file comparison.
« Last Edit: May 02, 2019, 10:43:00 AM by gwwilk »
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Updated advforecast2.php (JSON) V5.11 handles NWS API change
« Reply #19 on: May 02, 2019, 10:52:07 AM »
Ah.. my bad.  I've now updated to 5.12 with the corrected link to weather.gov pages for both point and zone forecasts.

*Sigh*
Sorry, but must be feeling lazy today after spending 4 hours yesterday finding the appropriate lines for adapting the stand-alone page script layout to my preferences....
I know I'm in the minority by using a stand-alone page (that has background and other layout modifications) but if there is only a line or two of change it would be a lot easier to change the altered line(s) than replace the whole page and then have to go back and change many lines of layout code.
If that is the case, only a line or two change, would it be possible to just post the changed lines? They are usually easy to find by doing a "Search" for line(s) to be changed.

You can make your life much easier (with a custom layout) by using the script to provide the data only and having your page do the printing of the HTML in the format you like.

Running
Code: [Select]
<?php 
$doPrintNWS 
false;
include_once(
"advforecast2.php");
?>
will get the data (silently) on the page.
You can lift entire display code from the advforecast2.php script and rearrange to your hearts delight and just rely on the script for getting data -- would make future updates much easier.

If you're not using the Saratoga template set, you can even fake out all the Settings.php entries used before invoking the script, so you can just plop in an updated version with no customization required.
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 Jasiu

  • Forecaster
  • *****
  • Posts: 947
    • LexMAWeather
Re: Updated advforecast2.php (JSON) V5.11 handles NWS API change
« Reply #20 on: May 02, 2019, 11:06:20 AM »
*Sigh*
Sorry, but must be feeling lazy today after spending 4 hours yesterday finding the appropriate lines for adapting the stand-alone page script layout to my preferences....
I know I'm in the minority by using a stand-alone page (that has background and other layout modifications) but if there is only a line or two of change it would be a lot easier to change the altered line(s) than replace the whole page and then have to go back and change many lines of layout code.
If that is the case, only a line or two change, would it be possible to just post the changed lines? They are usually easy to find by doing a "Search" for line(s) to be changed.

I'm in a similar situation. I happen to do my work on a Mac, which has Unix under the hood, and since I did a lot of development on Unix systems, I just resort to my old habits. But there is probably a more modern way to do this, no matter what the platform.

Anyway, here is what I do for files that I've modified:

1) Download the latest Ken update. I also save all of these, in separate folders indexed by the date I downloaded the update.

2) Using the Mac terminal (which gives me a Unix shell), I find the previous version of the same file in my Saratoga folder.

Code: [Select]
"find . -name '[file name]' -print | sort"
3) I then find the differences between those two versions.  Example:

Code: [Select]
diff -w 20190430Update/advforecast2JSON.php 20190502Update/advforecast2JSON.php | more
(a. note that I rename the JSON versions of the advforecast files; b. "-w" means "ignore whitespace").

The output is:

Code: [Select]
58a59
> //  Version 5.12 - 01-May-2019 - fix for link URL at bottom of page
61c62
< $Version = 'advforecast2.php (JSON) - V5.11 - 30-Apr-2019';
---
> $Version = 'advforecast2.php (JSON) - V5.12 - 01-May-2019';
388c389
< $backupfileName = APIURL . "/zones/JSON-LD/$NOAAZone/forecast";
---
> $backupfileName = APIURL . "/zones/forecast/$NOAAZone/forecast";
402c403
< $backupfileName = APIURL . "/zones/JSON-LD/".$META['forecastZone']."/forecast";
---
> $backupfileName = APIURL . "/zones/forecast/".$META['forecastZone']."/forecast";
1214c1215
<     echo htmlspecialchars($zoneURL);
---
>     echo htmlspecialchars(FCSTURL."/zone/".$META['forecastZone']);
1217c1218
<     echo htmlspecialchars($pointURL);
---
>     echo htmlspecialchars( FCSTURL."/point/".$META['point']);

4) In an editor, I open both my version of the file and Ken's latest. Following the results of the "diff", I apply the changes.

If we want to dig into this more and come up with procedures that are not so Unix (and Unix nerd) specific, we should probably start a new thread.
https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 947
    • LexMAWeather
Re: Updated advforecast2.php (JSON) V5.11 handles NWS API change
« Reply #21 on: May 02, 2019, 11:09:27 AM »

You can make your life much easier (with a custom layout) by using the script to provide the data only and having your page do the printing of the HTML in the format you like.

Running
Code: [Select]
<?php 
$doPrintNWS 
false;
include_once(
"advforecast2.php");
?>
will get the data (silently) on the page.
You can lift entire display code from the advforecast2.php script and rearrange to your hearts delight and just rely on the script for getting data -- would make future updates much easier.

If you're not using the Saratoga template set, you can even fake out all the Settings.php entries used before invoking the script, so you can just plop in an updated version with no customization required.

Ah, yes, I do that too. Highly recommended.
 
https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Updated advforecast2.php (JSON) V5.11 handles NWS API change
« Reply #22 on: May 02, 2019, 11:43:16 AM »
Great!  That's what was intended for easy standalone (non-template) usage.  The hints on how what to provide in $SITE[] variables can be found in the script just below the settings info in the script.  For advforecast2.php (JSON) that reads
Code: [Select]
// overrides from Settings.php if available
global $SITE;
if (isset($SITE['NWSforecasts']))    {$NWSforecasts = $SITE['NWSforecasts']; }
if (isset($SITE['cacheFileDir']))    {$cacheFileDir = $SITE['cacheFileDir']; }
if (isset($SITE['noaazone']))        {$NOAAZone = $SITE['noaazone'];}
if (isset($SITE['fcsturlNWS']))      {$fileName = $SITE['fcsturlNWS'];}
if (isset($SITE['fcsticonsdir']))    {$iconDir = $SITE['fcsticonsdir'];}
if (isset($SITE['fcsticonstype']))   {$iconType = $SITE['fcsticonstype'];}
if (isset($SITE['fcsticonsheight'])) {$iconHeight = $SITE['fcsticonsheight'];}
if (isset($SITE['fcsticonswidth']))  {$iconWidth = $SITE['fcsticonswidth'];}
if (isset($SITE['tz']))              {$ourTZ = $SITE['tz'];} // V5.00
if (isset($SITE['timeFormat']))      {$timeFormat = $SITE['timeFormat'];} // V5.00
if (isset($SITE['showTwoIconRows'])) {$showTwoIconRows = $SITE['showTwoIconRows'];} // V5.00
if (isset($SITE['showZoneWarning'])) {$showZoneWarning = $SITE['showZoneWarning'];} // V5.00
// end of overrides from Settings.php
  so the including page can have
Code: [Select]
<?php
$SITE 
= array();
global 
$SITE;
$doPrintNWS false;

$SITE['NWSforecasts'] = array(
  
// the entries below are for testing use.. replace them with your own entries if using the script
  // outside the AJAX/PHP templates.
  // ZONE|Location|point-forecast-URL  (separated by | characters
  
"CAZ513|Saratoga, CA (WRH)|http://forecast.weather.gov/MapClick.php?CityName=Saratoga&state=CA&site=MTR&textField1=37.2639&textField2=-122.022&e=1&TextType=2",
);
$SITE['cacheFileDir'] = './';
$SITE['noaazone'] = 'CAZ513';
$SITE['fcsturlNWS'] = 'http://forecast.weather.gov/MapClick.php?CityName=Saratoga&state=CA&site=MTR&textField1=37.2639&textField2=-122.022&e=1&TextType=2';
$SITE['fcsticonsdir'] = './forecast/images/';
$SITE['fcsticonstype'] = '.jpg';
$SITE['fcsticonsheight'] = 55;
$SITE['fcsticonswidth'] = 55;
$SITE['tz'] = 'America/Los_Angeles'
$SITE['timeFormat'] = 'g:i a T M d, Y'
$SITE['showTwoIconRows'] = true;
$SITE['showZoneWarning'] = true;
include_once(
"advforecast2.php");
?>

to make the script have all the required customizations applied without modifying the advforecast2.php script itself, and you can add whatever printing you want .. the data is what you get to use :)

To address the code versioning issue, I'll look at setting up a github distribution for all the standalone scripts now that I have some experience with it doing the Cumulus HomeWeatherStation template from Brian Underdown (https://github.com/ktrue/CU-HWS)
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: Updated advforecast2.php (JSON) V5.11 handles NWS API change
« Reply #23 on: May 02, 2019, 02:05:07 PM »
Not that I really needed more projects, but using GitHub is a good idea, so I've established repositories for all my Standalone-capable scripts at https://github.com/ktrue/
edit: I've decided to make separate repositories for each script set so it's easier to clone/track/download just that script.

I've added the advforecast2.php script there (at https://github.com/ktrue/NWS-forecast ) and will be populating the other parts of the distributions with the various current scripts over time.  It's a bit labor-intensive (even with some automation help) to convert the existing HTML docs to MarkDown for the README.md in each directory for the scripts.  I'm using Atom for the Markdown editor (and some repository add/commit) and GIT Bash for pushing. 

For any scripts updated in the repository in the future, you'll be able to easily see the diff for the old->new versions provided by GIT automatically.  Bonus...
« Last Edit: May 03, 2019, 12:38:16 AM by saratogaWX »
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 lddaly

  • Forecaster
  • *****
  • Posts: 490
Re: Updated advforecast2.php (JSON) V5.11 handles NWS API change
« Reply #24 on: May 24, 2019, 10:44:09 PM »
Since we are a month out from being forced :grin:, I finally dropped the latest advforecast2.php 5.12 onto my site to replace the version 4.05 I was previously running. Works great! Thank you, Ken! [tup]

My only question relates to formatting on my alt-dashboard 6.95c (not a critical issue, just aesthetics). My site/dashboard is a little bit wider than the default (850px). The old forecast icons displayed perfectly aligned, the new forecast does not (old and new examples below). All of my usual formatting tricks are not working and it looks like the $forecasticons width may be handled differently in the new script? Does anyone have any ideas or suggestions for getting them to align evenly again?