Author Topic: New PW-forecast.php script for international/multilingual forecasts  (Read 661 times)

0 Members and 1 Guest are viewing this topic.

Online saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9378
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
As you likely know, after Apple bought DarkSky, the ability to get new DarkSky API keys vanished, and the API itself is soon to be withdrawn from availability.  Fortunately, a PhD student has cobbled together an API using public weather data (GFS, GEFS, HRRR) on Amazon Web Services and is offering a free API in the DarkSky format.  WooHoo, said I.  So I've adapted my existing (and soon to be obsolete) DS-forecast.php to use the new API.

The site offering the API is https://pirateweather.net/  ('pirate' because HRRR sounds like the ARRRR that pirates supposedly used).

The new API is not quite as full-featured as the real DarkSky API:
1) English text responses only (but the PW-forecast.php handles multilingual translations built-in)
2) Sparse 'conditions' text.. usually only one word.
3) Alerts are just titles.. no link to details

I'll be adding the offering to the Base-World template set next week.  The script set is available from two sources:

https://saratoga-weather.org/scripts-PWforecast.php  and https://github.com/ktrue/PW-forecast

See the demo at https://saratoga-weather.org/PW-forecast-demo.php

« Last Edit: January 14, 2023, 08:33:14 PM 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 zmarfak

  • Contributor
  • ***
  • Posts: 135
    • Matar
Re: New PW-forecast.php script for international/multilingual forecasts
« Reply #1 on: January 19, 2023, 04:06:26 AM »
Ken,
thank you for the work to create the scripts.

The timeline based on Merry-Timeline by Guillaume Carbonneau gives the time in "am/pm" format,  do you have any idea if this could be set in 24-hour format ?
Or did I forgot a setting to do this ?
Patrick
Davis Vantage Pro2 with a Meteobridge NANO SD and WL (6.04) on a Intel NUC 
https://www.matar.be

Online saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9378
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: New PW-forecast.php script for international/multilingual forecasts
« Reply #2 on: January 19, 2023, 12:17:02 PM »
Ahh.. the Merry-Timeline script had only am/pm notation available.  I've updated the script to V2.51 to check $timeFormat/$SITE['timeFormat'] for 'g' (12 hr time) and set to am/pm, otherwise use 'H' (2-digit 24hr time).

Thanks for the suggestion!  Available now on the update tool page for Base-World, the script page on my site, and on GitHub.
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 zmarfak

  • Contributor
  • ***
  • Posts: 135
    • Matar
Re: New PW-forecast.php script for international/multilingual forecasts
« Reply #3 on: January 19, 2023, 12:54:10 PM »
Nice !
Thank you Ken.
Patrick
Davis Vantage Pro2 with a Meteobridge NANO SD and WL (6.04) on a Intel NUC 
https://www.matar.be