Author Topic: WC-forecast.php script under development  (Read 3040 times)

0 Members and 1 Guest are viewing this topic.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9297
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
WC-forecast.php script under development
« on: February 20, 2019, 11:26:00 AM »
Since Wunderground PWS data submitters can now (as of 19-Feb-2019) get an API key for the api.weather.com site, I got a key yesterday and started work on a WC-forecast.php script based on the prior WU-forecast.php script.

I also got a new key and am working on a WC-forecast.php script (based on the old, soon to be deprecated WU-forecast.php script).

I initially couldn't get a key with Firefox, but was successful with Chrome (after signing in to my WU ID).

Missing from the returned JSON is a timestamp representing WHEN the forecast was done.. only a 'validfrom' date set was found.  Also missing is any meta-data about location name.  It's also only a 5 day forecast (10 icons).

The language stuff works just fine and returns UTF-8 text in the requested language.
I'll let you know when the script is ready for beta testing.

I've done a preliminary mapping of their icon codes to icons used with the NWS/Saratoga and Meteotriviglio sets.



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 SteveFitz1

  • Forecaster
  • *****
  • Posts: 521
    • Tyler Texas Weather
Re: WC-forecast.php script under development
« Reply #1 on: February 20, 2019, 12:18:40 PM »
Ken,

Where did you sign up for the new API key? I'm supposed to be on the notification list and have been following the WU forum on the topic but haven't seen the opening for signup yet. Perhaps I missed it. Can you share the link?

Thanks,

Steve

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9297
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: WC-forecast.php script under development
« Reply #2 on: February 20, 2019, 01:40:03 PM »
Hi Steve,
Here's the letter I got from Victoria yesterday.  Note that you have to be signed on the wunderground site with your userid/pass before you try the link to get your API key --

Quote
Dear PWS uploaders, thank you for your continued loyalty and patience!
 
The gateway for the new API keys for PWS uploaders is open.
 
Navigate to:  <redacted>  (Link removed.. you’ll get it when you get the email directly)
 
You will then see a blank box below “Your API keys”.  Agree to the new Terms and Conditions by clicking in the small box next to “I agree”, click on the blue “GENERATE” box, and your new key will be created.
 
The key will be masked on the screen, but you can use the “Show” link below the box to see it.  There is also another blue box, which, when clicked, copies the key to your clipboard.
 
Once you have your new key, you can use it in the NEW (not old!) API’s commands.  The documentation for those commands is here:  https://docs.google.com/document/d/1eKCnKXI9xnoMGRRzOL1xPCBihNV2rOet08qpE_gArAY/edit
 
The new API should work immediately once you have the new key in the new commands.
 
If you have any problems, or any of this is not clear, please respond to this email.  You may also respond and let me know if everything is successful!  But I am at the ready to help if there is a problem.
 
 
Victoria Gardner
Weather Underground API customer service
« Last Edit: February 21, 2019, 10:32:28 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 SteveFitz1

  • Forecaster
  • *****
  • Posts: 521
    • Tyler Texas Weather
Re: WC-forecast.php script under development
« Reply #3 on: February 20, 2019, 01:59:53 PM »
Ken,

Thanks for the info. Unfortunately, it doesn't work for me. After signing into WU and going to the link in the email, it shows this under Your API Keys - "Session timed out. Reload the page". There are no boxes to click. And, of course, I get this again when I reload the page. And I tried it on 3 different browsers.

I verified my API key with Victoria a couple of weeks ago and she added me to her mailing list. Since I haven't heard anything yet and I don't have the option to get a key on the page, I'm wondering if they are doing a scaled rollout and limiting the number of new key requests in the first wave, especially since there is no mention of the new keys being available yet on their forum.

Guess I'll have to be patient.

Thanks for providing the info.

Steve

Offline SteveFitz1

  • Forecaster
  • *****
  • Posts: 521
    • Tyler Texas Weather
Re: WC-forecast.php script under development
« Reply #4 on: February 20, 2019, 03:57:23 PM »
Ken,

I talked with Victoria. The rollout is very limited. Seems lots of folks like myself are having issues and have been unable to get a new key. I tried on 4 different browsers and got the same message on all. She will be passing my issue on to development.

Steve

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9297
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: WC-forecast.php script under development
« Reply #5 on: February 20, 2019, 07:29:48 PM »
I must be charmed to be amongst the first few for the rollout .. maybe it was the many emails exchanged with Victoria that helped :)

So, spent about 5 hours getting a prototype of the WC-forecast.php working on a local server.  It now gets and formats the forecasts, replacing the Weather.com graphics with NWS/Montetriviglio icons like my other scripts for NWS and DarkSky (and the old WU script).

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 smokie

  • Senior Member
  • **
  • Posts: 51
    • Newquay Cornwall. UK
Re: WC-forecast.php script under development
« Reply #6 on: February 21, 2019, 03:13:10 AM »
I just tried, got the "Session timed out. Reload the page" with chrome,

Tried Firefox got the box to generate key, but on pressing got "Key generation failed. Try again later."
Newquay, Cornwall.UK  > WS2300 Operational since May 2007. New home from 6/4/08 www.newquayweather.com

Offline ConligWX

  • Forecaster
  • *****
  • Posts: 843
  • #conligwx
    • conligwx.org
Re: WC-forecast.php script under development
« Reply #7 on: February 21, 2019, 05:56:46 AM »
working here. make sure you dont have any ad blockers running on that webpage.
Regards Simon
Davis Vantage Pro2 Plus (6162UK) • Daytime FARS • WeatherLink Live • AirLink • PurpleAir PA-II-SD • CumulusMX •


Offline ConligWX

  • Forecaster
  • *****
  • Posts: 843
  • #conligwx
    • conligwx.org
Re: WC-forecast.php script under development
« Reply #8 on: February 21, 2019, 06:00:54 AM »
I must be charmed to be amongst the first few for the rollout .. maybe it was the many emails exchanged with Victoria that helped :)

So, spent about 5 hours getting a prototype of the WC-forecast.php working on a local server.  It now gets and formats the forecasts, replacing the Weather.com graphics with NWS/Montetriviglio icons like my other scripts for NWS and DarkSky (and the old WU script).

Ken if you need testers let me know. Managed to get an api here without issue.
Regards Simon
Davis Vantage Pro2 Plus (6162UK) • Daytime FARS • WeatherLink Live • AirLink • PurpleAir PA-II-SD • CumulusMX •


Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 1314
  • BismarckWeather.net
    • BismarckWeather.net
Re: WC-forecast.php script under development
« Reply #9 on: February 21, 2019, 09:44:29 AM »
Any indication if they will be supporting the old almanac data with the new API?
https://www.BismarckWeather.net
Davis VP2, Cumulus, WeatherDisplay, Blitzortung, Saratoga Scripts, NOAA Stream via PI

Online wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: WC-forecast.php script under development
« Reply #10 on: February 21, 2019, 09:49:28 AM »
Any indication if they will be supporting the old almanac data with the new API?
No almanac data in the free pws api
This link list all available data:
https://docs.google.com/document/d/1eKCnKXI9xnoMGRRzOL1xPCBihNV2rOet08qpE_gArAY/mobilebasic
Wim

Offline Brientim

  • Contributor
  • ***
  • Posts: 123
Re: WC-forecast.php script under development
« Reply #11 on: February 21, 2019, 11:57:03 AM »
I must be charmed to be amongst the first few for the rollout .. maybe it was the many emails exchanged with Victoria that helped :)

So, spent about 5 hours getting a prototype of the WC-forecast.php working on a local server.  It now gets and formats the forecasts, replacing the Weather.com graphics with NWS/Montetriviglio icons like my other scripts for NWS and DarkSky (and the old WU script).
Visibility would have no doubt help and it is good to hear that at least there is some movement on this front.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9297
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: WC-forecast.php script under development
« Reply #12 on: February 21, 2019, 01:00:41 PM »
Victoria emailed me that the rollout of the API key generation is happening slowly while some bugs are being worked out on the WU site.  She's not sent full blast of emails while there are still issues.  Some more invitations will be emailed today.

Should be soon for the general release of the API key generation, and when it goes general, the 2 week clock will start on shutdown of the existing WU API keys.
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 smokie

  • Senior Member
  • **
  • Posts: 51
    • Newquay Cornwall. UK
Re: WC-forecast.php script under development
« Reply #13 on: February 21, 2019, 01:33:10 PM »
Finally got my key, using IE, now that's a turn up for the books, Chrome and Firefox no go.
Newquay, Cornwall.UK  > WS2300 Operational since May 2007. New home from 6/4/08 www.newquayweather.com

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9297
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: WC-forecast.php script under development
« Reply #14 on: March 01, 2019, 12:16:27 AM »
Y'all are welcome to try V1.00 of the WC-forecast.php script now

https://saratoga-weather.org/scripts-WCforecast.php

There's a demo at https://saratoga-weather.org/WC-forecast-demo.php to show how it works.

You will need to acquire a WU API key (which is only available to WU members with a PWS submitting data to WU) in order to use this script on your site.  I'll be adding it as an optional script in the Base-World Saratoga template tomorrow.  I'm going to keep the DarkSky script as the main one since this script only works for WeatherUnderground members, while DarkSky will work for anyone.
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 ConligWX

  • Forecaster
  • *****
  • Posts: 843
  • #conligwx
    • conligwx.org
Re: WC-forecast.php script under development
« Reply #15 on: March 01, 2019, 02:42:43 AM »
Thanks for all your hard work Ken.  Much appreciated.  =D&gt;
Regards Simon
Davis Vantage Pro2 Plus (6162UK) • Daytime FARS • WeatherLink Live • AirLink • PurpleAir PA-II-SD • CumulusMX •


Offline marko30

  • Member
  • *
  • Posts: 12
Re: WC-forecast.php script under development
« Reply #16 on: March 01, 2019, 04:02:50 AM »
Very nice work Ken, as always.
Is there also possibility to use new API, to make a table, where current conditions from choosen PWS's are shown?

Offline miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 4109
  • KE8DAF
    • Sunrise Side Weather in Rogers City MI USA
Re: WC-forecast.php script under development
« Reply #17 on: March 01, 2019, 08:30:53 AM »
I am getting the "Key generation failed. Try again later." message. I downloaded the script and I will experiment with it once WU's key gen starts working again.

Greg H.


Blitzortung Stations #706 and #1682
CoCoRaHS: MI-PI-1
CWOP: CW4114 and KE8DAF-13
WU: KMIROGER7
Amateur Radio Callsign: KE8DAF

Offline SteveFitz1

  • Forecaster
  • *****
  • Posts: 521
    • Tyler Texas Weather
Re: WC-forecast.php script under development
« Reply #18 on: March 01, 2019, 08:52:02 AM »
Greg,

Have you tried going through the WU-API signup process using the Chrome browser in Incognito mode? This method worked for me and some others I know, but not for everyone.

Steve

Offline miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 4109
  • KE8DAF
    • Sunrise Side Weather in Rogers City MI USA
Re: WC-forecast.php script under development
« Reply #19 on: March 01, 2019, 09:22:07 AM »
I just tried it using MS Edge and it worked. I don't know what the deal is with Firefox, I get this kind of behavior sometimes. A first I thought it was the ad-blocker, but I shut it off and it didn't make any difference. I got the API key now. Thanks.

Quote
Finally got my key, using IE, now that's a turn up for the books, Chrome and Firefox no go.

Well, duh. I should have read this...  :oops:

Greg H.


Blitzortung Stations #706 and #1682
CoCoRaHS: MI-PI-1
CWOP: CW4114 and KE8DAF-13
WU: KMIROGER7
Amateur Radio Callsign: KE8DAF

Offline miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 4109
  • KE8DAF
    • Sunrise Side Weather in Rogers City MI USA
Re: WC-forecast.php script under development
« Reply #20 on: March 01, 2019, 09:51:40 AM »
I put the key into my Settings.php. I am getting a blankish page with the drop-down box. (the default cities show there)
I commented out the key settings in the WC-forecast.php file itself.
I tried the "Force Update", but no joy.

Here is the link to my testing page: http://rogerscityweather.com/WC-forecast.php

Any suggestions? What did I do wrong?

Greg H.


Blitzortung Stations #706 and #1682
CoCoRaHS: MI-PI-1
CWOP: CW4114 and KE8DAF-13
WU: KMIROGER7
Amateur Radio Callsign: KE8DAF

Offline miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 4109
  • KE8DAF
    • Sunrise Side Weather in Rogers City MI USA
Re: WC-forecast.php script under development
« Reply #21 on: March 01, 2019, 10:01:11 AM »
I put the key into my Settings.php. I am getting a blankish page with the drop-down box. (the default cities show there)
I commented out the key settings in the WC-forecast.php file itself.
I tried the "Force Update", but no joy.

Here is the link to my testing page: http://rogerscityweather.com/WC-forecast.php

Any suggestions? What did I do wrong?

Greg H.

Where do these lines belong in Settings.php?

I broke my entire site (blank page on index.php) with this added into Settings.php.

Code: [Select]
// WU API Key
//$SITE['WCAPIkey'] = 'MY KEY INFO REDACTED';
//$WC LOC = 'Rogers City, MI, USA|45.41743,-83.81065'

Greg H.


Blitzortung Stations #706 and #1682
CoCoRaHS: MI-PI-1
CWOP: CW4114 and KE8DAF-13
WU: KMIROGER7
Amateur Radio Callsign: KE8DAF

Online wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: WC-forecast.php script under development
« Reply #22 on: March 01, 2019, 11:13:36 AM »
I put the key into my Settings.php. I am getting a blankish page with the drop-down box. (the default cities show there)
I commented out the key settings in the WC-forecast.php file itself.
I tried the "Force Update", but no joy.

Here is the link to my testing page: http://rogerscityweather.com/WC-forecast.php

Any suggestions? What did I do wrong?

Greg H.

Where do these lines belong in Settings.php?

I broke my entire site (blank page on index.php) with this added into Settings.php.

Code: [Select]
// WU API Key
//$SITE['WCAPIkey'] = 'MY KEY INFO REDACTED';
//$WC LOC = 'Rogers City, MI, USA|45.41743,-83.81065'

Greg H.
// WU API Key
$SITE['WCAPIkey'] = 'MY KEY INFO REDACTED';
$WC LOC = 'Rogers City, MI, USA|45.41743,-83.81065';

The text $WC LOC  are two words, and is not acceptetable for PHP
The line shoulds also end with a ;  after the quote

Offline miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 4109
  • KE8DAF
    • Sunrise Side Weather in Rogers City MI USA
Re: WC-forecast.php script under development
« Reply #23 on: March 01, 2019, 11:25:00 AM »
Thanks, Wim.

I spotted the missing semicolon ; just before I read your post.
Thanks for the missing underscore in WC_LOC. Got that fixed.
That "unbroke" the site and the test page, but I am still getting the Saratoga forecast data.
Working on it some more...

Greg H.




Blitzortung Stations #706 and #1682
CoCoRaHS: MI-PI-1
CWOP: CW4114 and KE8DAF-13
WU: KMIROGER7
Amateur Radio Callsign: KE8DAF

Offline miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 4109
  • KE8DAF
    • Sunrise Side Weather in Rogers City MI USA
Re: WC-forecast.php script under development
« Reply #24 on: March 01, 2019, 11:48:16 AM »
I had to manually delete the cached files that contained the Saratoga, CA forecasts. Now I am getting somewhere.
Is there a way to clear the cache other than going into FTP and deleting the cache files?

Greg H.


Blitzortung Stations #706 and #1682
CoCoRaHS: MI-PI-1
CWOP: CW4114 and KE8DAF-13
WU: KMIROGER7
Amateur Radio Callsign: KE8DAF

 

anything