WXforum.net

Web Weather => Weather Website PHP/AJAX scripting => Topic started by: saratogaWX on November 16, 2018, 07:01:33 PM

Title: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: saratogaWX on November 16, 2018, 07:01:33 PM
Given that WeatherUnderground has announced shutoff of the WU API on 31-Dec-2018, I thought it prudent to locate another source for forecasts that still offers free (low volume) access, is multilingual, and international coverage.  DarkSky.net fits that with some caveats:

1) forecasts are for 8 days (including today) and day-only forecasts are available (no night-time specific forecasts), but high/low expected temperatures are included for each day.

2) The DarkSky text forecast is quite terse (more like an icon description), so the script 'fleshes out' the text forecast a bit by adding High/Low temperatures, Chance of Precipitation (if>0%), Wind direction, speed->gust, and UV index to the text.
Because of the latter additions, for internationalization there is a required DS-forecast-lang.php which includes a encoded lookup array for day names+some weather terms in each supported language.  All languages supported in the current Saratoga templates are covered (af,bg,cs,ct,de,dk,el,en,es,fi,fr,he,hu,it,nl,no,pl,pt,ro,se,si,sk).

The DS-forecast.php script is for standalone or Saratoga-template usage, and can output the text in either UTF-8 or the ISO-8859-n languages used in the Saratoga templates.

I'll be doing some work to replace WU-forecast.php with DS-forecast.php in the Base-World template set soon.

You'll find the docs/downloads/demo at the scripts page https://saratoga-weather.org/scripts-DSforecast.php
and a Demo page at https://saratoga-weather.org/DS-forecast-demo.php

Enjoy!
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: Maumelle Weather on November 18, 2018, 02:35:58 PM
Hi Ken,

Thanks for the new forecast script. Wanted to let you know the signup URL you have returns a 404 for me. The one that I found that works was DarkSky API (https://darksky.net/dev).


John
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: saratogaWX on November 18, 2018, 03:30:36 PM
Thanks John,
I'll change the docs..  I'd originally done the script in December 2017 but hadn't finished it.. added the finishing touches (like translations) and forgot to check the original doc url for signup.
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: W Thomas on November 26, 2018, 11:01:37 PM
I have been experimenting with the Dark Sky forecast script as a likely replacement for my WU Specialized forecast.
I have a strange temperature display meaning it is displaying way colder temperatures than we are expecting. However I know it's colder than a well drillers auger here but I actually hope those temps are wrong  8-)

You can see what I am talking about here   http://www.smythweather.net/TestBed/DS-Forecast.php?z=0 (http://www.smythweather.net/TestBed/DS-Forecast.php?z=0)
I haven't gotten the icons working yet,they are uploaded but I've missed something there as well :grin:

I'm open for ideas on this little issue.  So far I really like the data from DarkSky and Ken's excellent coding work! Seems they page call volume is more than enough for me. I wish I had oodles of hits per day but alas I dont :lol:

Thanks in advance!
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: saratogaWX on November 27, 2018, 10:40:24 AM
For the images, you might try using
Code: [Select]
$iconDir ='../forecast/images/'; // directory for carterlake icons './TestBed/images/'
since you have the icons in your main directory.

Thanks for the kind words :)
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: W Thomas on November 27, 2018, 10:57:15 AM
Thanks Ken!
Working great now!
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: pimohdaimaoh on November 29, 2018, 06:00:32 AM
Hello ken,

This is what im waiting Ken and good job creating it early so that we can ready/preparing of transfering our forecast script from WU, before WU is going to close on Dec 31 this year. I am now beginning to transfer its script from WU to DS, but I have a problem. since I change the WU-forecast.php into DS-forecast.php in settings why the DS-forecast.php also showing on my ajax dashboard? I didnt include this on ajax-dashboard? it should only view on wxDSforecast.php? (see image) how to remove this on ajax-dashboard which it should only view the variables on ajax-dashboard, instead?

Hope you can help me to fix it.

regardss;

Mike
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: chappelledpc on November 29, 2018, 12:26:47 PM
Hi Ken,

Thanks for making this available.  Have a question about the forecast text that shows up under the icons.

If you take a look at my example below, you see that the text after the snow amount for Sunday and Monday is getting truncated.  Does have something to do with the close parenthesis ) or possibly the period after in

Thanks,
Doug

 [ You are not allowed to view attachments ]
 
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: saratogaWX on November 29, 2018, 12:28:47 PM
Looks like you discovered that changing the Settings.php from
Code: [Select]
$SITE['fcstscript']    = 'WU-forecast.php';    // Non-USA, Non-Canada Wunderground Forecast Script
$SITE['fcstorg']        = 'WU';    // set to 'WU' for WeatherUnderground
to use DarkSky instead won't work correctly.  I have to issue some updates to Settings.php, ajax-dashboard.php, wxforecast.php to allow easy integration of DS-forecast.php into the Saratoga template.
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: saratogaWX on November 29, 2018, 12:33:07 PM
I think it's a browser/HTML issue with their return.  The JSON says 'Light snow (< 1 in.) in the morning.'

I think I'll have to add a bit of processing to make that 'Light snow (&amp; 1 in.) in the morning.' so the browser's HTML parser won't be confused and thing there's an open tag starting.   :roll: #-o
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: saratogaWX on November 29, 2018, 12:54:12 PM
Try changing
Code: [Select]
$DSforecasttext[$n] = trim($FCpart['summary']); to
Code: [Select]
$DSforecasttext[$n] =
   str_replace(array('<','>','–','cm.','in.'),array('&lt;','&gt;','-','cm','in'),
   trim($FCpart['summary']));
That seems to get the correct stuff displayed.
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: chappelledpc on November 29, 2018, 03:48:12 PM
Thanks Ken.  That did fix it  =D&gt;

One interesting note is the forecast did change from my last post, but the updated time didn't.  Looks like they are using midnight hour consistently in the daily array.  Maybe you can consider using $JSON['currently']['time'] rather than $JSON['daily']['data'][0]['time'] for the $DSupdated variable?  Just a thought.

Thanks,
Doug

 [ You are not allowed to view attachments ]
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: saratogaWX on November 29, 2018, 03:53:52 PM
Funny you should mention the update time.. I'd sent them an email suggesting both a "updated" JSON entry with the UTC timestamp for the forecast (it doesn't have that now), AND to consider offering Day/Night forecasts instead of just Full Day forecasts.
They said they would forward to the developers.

Meanwhile, the only date provided by them is midnight local time for the first period in the forecast.  Yes, they do update the forecasts multiple times per day, but the JSON doesn't have a field to represent that.  Using the current time would give a false impression of the actual forecast time IMHO..
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: chappelledpc on November 29, 2018, 04:01:39 PM
Funny you should mention the update time.. I'd sent them an email suggesting both a "updated" JSON entry with the UTC timestamp for the forecast (it doesn't have that now), AND to consider offering Day/Night forecasts instead of just Full Day forecasts.
They said they would forward to the developers.

Meanwhile, the only date provided by them is midnight local time for the first period in the forecast.  Yes, they do update the forecasts multiple times per day, but the JSON doesn't have a field to represent that.  Using the current time would give a false impression of the actual forecast time IMHO..

I agree that would give a false impression.  We'll see how open and responsive they are to suggestions.
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: pimohdaimaoh on November 29, 2018, 05:54:15 PM
Looks like you discovered that changing the Settings.php from
Code: [Select]
$SITE['fcstscript']    = 'WU-forecast.php';    // Non-USA, Non-Canada Wunderground Forecast Script
$SITE['fcstorg']        = 'WU';    // set to 'WU' for WeatherUnderground
to use DarkSky instead won't work correctly.  I have to issue some updates to Settings.php, ajax-dashboard.php, wxforecast.php to allow easy integration of DS-forecast.php into the Saratoga template.

Yes ken, when I change these to DS-forecasts.php, the wxforecast.php works fine, except the above I mentioned which the stand alone of DS-forecast.php also showing on the ajax-dashboard in which supposed not to. I hope you look on that issue soon. Thank You.
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: saratogaWX on November 29, 2018, 07:23:37 PM
To use DarkSky forecast requires changes to ajax-dashboard.php, Settings.php, wxforecast.php scripts that I'm working on, but haven't released.  For now, just stick with WU-forecast.php as it is working for you.

There will be a future Base-World update to replace WU-forecast.php with DS-forecast.php with instructions on how to do that..
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: saratogaWX on December 08, 2018, 02:18:59 PM
I've done an update to the DarkSky scripts today (8-Dec-2018) DS-forecast.php V1.05, DS-forecast-lang.php V1.04 that has the following additions:

1) a new current-conditions block can now be displayed (default is to display it).  DarkSky JSON has a current entry with conditions from a nearby station generally available.  The Icon, conditions, sunrise/set, distance from forecast point and overall summary are displayed in the block.  This is similar to the display with the ec-forecast.php script for Canadian forecasts.
 
2) if precipitation is forecast, the type of precip (rain, snow, sleet) also appears in the text forecast like the 'Chance of precipitation (rain) nn%'.

3) since DarkSky has a very limited set of icons specified (currently limited to clear-day, clear-night, rain, snow, sleet, wind, fog, cloudy, partly-cloudy-day, or partly-cloudy-night), I've added a routine to use the cloud-coverage (converted to octets) to change the clear-*, partly-cloudy-* specs to use SKC, FEW, SCT, BKN, OVC icons as appropriate.  Also, for wind icon, the same cloud-coverage is applied.
Even with these changes, DarkSky continues to use -night icons when talking about full-day forecasts sometimes.

Update is available from the scripts page (https://saratoga-weather.org/scripts-DSforecast.php) (update both scripts) and the Template update tool page (https://saratoga-weather.org/wxtemplates/updates.php) ( query for 08-Dec-2018, Base-World, *-plugin)
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: ConligWX on December 08, 2018, 06:01:43 PM
Ken,

from the main dashboard view can I remove the wording under the icon at all and just leave the Icon and Max/Min Temps or is the Words and Icons linked together?
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: saratogaWX on December 08, 2018, 07:12:37 PM
The data for DS-forecast.php is returned in:

 $DSforecastday[$i]   - period of forecast
 $DSforecasttext[$i]   - text of forecast
 $DSforecasttemp[$i]   - Temperature with text and formatting
 $DSforecastpop[$i]   - Number - Probabability of Precipitation ('',10,20, ... ,100)
 $DSforecasticon[$i]   - base name of icon graphic to use
 $DSforecastcond[$i]   - Short legend for forecast icon
 $DSforecasticons[$i]  - Full icon with Period, <img> and Short legend.
 $DSforecastwarnings = styled text with hotlinks to advisories/warnings
 $DScurrentConditions = table with current conds at point close to lat/long selected

The $DSforecasticons[$i] array has day-name,icon,text but not the temps.  The temps are in $DSforecasttemp[$i] as formatted text.

In ajax-dashboard.php  the compatibility code does stuff like
Code: [Select]
if ($fcstorg == 'DarkSky') {
  $forecasticons = $DSforecasticons;
  $forecasttemp = $DSforecasttemp;
  $forecasttitles = $DSforecasttitles;
  $forecasttext = $DSforecasttext;

}
so the dashboard can display the output in the 'Outlook' and Short term forecast areas (which use the $forecast* variable names.  The same kind of mapping is done for ec-forecast, WXSIM plaintext-parser, and WU-forecast scripts.
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: ConligWX on January 15, 2019, 07:17:40 AM
Ken I just got the dreaded 0 byte cache file issue today. had to manually delete the file for it to create again. even clicking on the "force" link didnt do anything.

I have now added the following to the top of my DS-forecast script.

Code: [Select]
$filename = './cache/DS-forecast-json-0-uk2-en.txt';

if (file_exists($filename)) {

$zerosize = filesize('./cache/DS-forecast-json-0-uk2-en.txt');

if ($zerosize === 0) {
unlink('./cache/DS-forecast-json-0-uk2-en.txt');
} }

does the force link not check for 0 byte files and remove them?
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: saratogaWX on January 15, 2019, 01:29:45 PM
?force=1 on the wxforecast/DS-forecast.php URL should force the fetch of a new file.  The issue is that that fetch may fail and store the failure in the cache.  I'll workup a fix to validate the expected JSON is returned before saving the cache file.. that would allow a prior saved cache to be reused (and refreshed automatically when good JSON again returns).

I'll let you know when the update is available.
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: saratogaWX on January 15, 2019, 02:31:39 PM
Ok, it was a bit complicated.  I check for a valid JSON return and if one is not found, the new cache is not saved.
If an existing old cache was found (and > 3000 bytes), it's used instead, otherwise an error message is posted and the script returns.  A view-source on the script shows all the diagnostic data needed.

Try V1.08 attached.

ed.  removed attachment.  Script distributed has a couple more changes so get it from the script page or via the template update mechanism.  Y'all know the drill :)
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: ConligWX on January 15, 2019, 02:50:42 PM
Thanks Ken.

Sent from my ONEPLUS A6003 using Tapatalk

Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: saratogaWX on January 15, 2019, 06:40:28 PM
Do download a fresh copy from the usual places.. some other tweaks including display of alerts for non-English use were done on V1.08
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: saratogaWX on January 23, 2019, 07:25:29 PM
Updated DS-forecast.php V1.09, DS-forecast-lang.php V1.06 (and for template users wxforecast.php V1.02) today.

The program now produces a tabbed display with one tab for daily forecasts, the second tab for 24hrs of hourly forecasts.

Standalone: https://saratoga-weather.org/scripts-DSforecast.php
Template: https://saratoga-weather.org/wxtemplates/updates.php Query for Base-World, Plugin-* 23-Jan-2018

Best regards,
Ken
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: ConligWX on January 24, 2019, 03:14:00 AM
Hi Ken.

Not sure what I have done, but my forecasts are not tabbed. just a "link" to the Daily/Hourly forecasts and both are shown on the same page.

https://www.conligwx.org/wxforecast.php

https://www.conligwx.org/DS-forecast.php

I've used a default DS-forecast (base) and only added my api key. its still the same. also an added "?>" appears at top of screen when calling DS-forecast.php directly.

 [ You are not allowed to view attachments ]
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: smokie on January 24, 2019, 06:18:56 AM
I get the same too, no tab, and links
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: ConligWX on January 24, 2019, 08:12:15 AM
Thanks for confirming.
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: wvdkuil on January 24, 2019, 09:06:31 AM
Thanks for confirming.
A small piece containing the CSS seems to be not available, is hould have been at the extra " ? >"
I added it in, please try this one

Wim

Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: ConligWX on January 24, 2019, 09:31:11 AM
Thanks for the file wim. worked a treat!
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: smokie on January 24, 2019, 09:55:34 AM
Thank you for the fix, Wim
Working now
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: saratogaWX on January 24, 2019, 10:45:14 AM
Oops!  :oops:  #-o
Thanks Wim,  =D&gt; I've updated the distribution with the missing CSS for the tabber.
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: Theo on January 24, 2019, 02:26:58 PM
I have the same problem, but the updated file is not solving it for me.  I did create the wxdsforecast.php as Ken suggested:

<?php
############################################################################
#       This document uses Tab 4 Settings
############################################################################
require_once("Settings.php");
require_once("common.php");
############################################################################
$TITLE = langtransstr($SITE['organ']) . " - " .langtransstr('Sample Blank Page');
$showGizmo = true;  // set to false to exclude the gizmo
include("top.php");
############################################################################
?>
</head>
<body>
<?php
############################################################################
include("header.php");
############################################################################
include("menubar.php");
############################################################################
?>

<div id="main-copy">

  <?php
                 $doIncludeDS  = true; // handle DS-forecast include
                 include_once('DS-forecast.php'); ?>

</div><!-- end main-copy -->

<?php
############################################################################
include("footer.php");
############################################################################
# End of Page
############################################################################
?>

Any ideas?  If I directly hit DS-forecast.php it works, just not within this wrapper.
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: saratogaWX on January 24, 2019, 02:35:29 PM
Yes.. the missing ingredient is the CSS to control the tabber/tabs display.

For wxdsforecast.php try
Code: [Select]
<?php
############################################################################
#       This document uses Tab 4 Settings
############################################################################
require_once("Settings.php");
require_once(
"common.php");
############################################################################
$TITLE langtransstr($SITE['organ']) . " - " .langtransstr('Sample Blank Page');
$showGizmo true;  // set to false to exclude the gizmo
include("top.php");
############################################################################
?>

<style type="text/css">
/*--------------------------------------------------
  tabbertab
  --------------------------------------------------*/
/* $Id: example.css,v 1.5 2006/03/27 02:44:36 pat Exp $ */

/*--------------------------------------------------
  REQUIRED to hide the non-active tab content.
  But do not hide them in the print stylesheet!
  --------------------------------------------------*/
.tabberlive .tabbertabhide {
 display:none;
}

/*--------------------------------------------------
  .tabber = before the tabber interface is set up
  .tabberlive = after the tabber interface is set up
  --------------------------------------------------*/
.tabber {
}
.tabberlive {
 margin-top:1em;
}

/*--------------------------------------------------
  ul.tabbernav = the tab navigation list
  li.tabberactive = the active tab
  --------------------------------------------------*/
ul.tabbernav
{
 margin:0 0 3px 0;
 padding: 0 3px ;
 border-bottom: 0px solid #778;
 font: bold 12px Verdana, sans-serif;
}

ul.tabbernav li
{
 list-style: none;
 margin: 0;
 min-height:40px;
 display: inline;
}

ul.tabbernav li a
{
 padding: 3px 0.5em;
min-height: 40px;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
 margin-left: 3px;
 border: 1px solid #778;
 border-bottom: none;
 background: #DDE  !important;
 text-decoration: none !important;
}

ul.tabbernav li a:link { color: #448  !important;}
ul.tabbernav li a:visited { color: #667 !important; }

ul.tabbernav li a:hover
{
 color: #000;
 background: #AAE !important;
 border-color: #227;
}

ul.tabbernav li.tabberactive a
{
 background-color: #fff !important;
 border-bottom: none;
}

ul.tabbernav li.tabberactive a:hover
{
 color: #000;
 background: white !important;
 border-bottom: 1px solid white;
}

/*--------------------------------------------------
  .tabbertab = the tab content
  Add style only after the tabber interface is set up (.tabberlive)
  --------------------------------------------------*/
.tabberlive .tabbertab {
 padding:5px;
 border:0px solid #aaa;
 border-top:0;
overflow:auto;

}

/* If desired, hide the heading since a heading is provided by the tab */
.tabberlive .tabbertab h2 {
 display:none;
}
.tabberlive .tabbertab h3 {
 display:none;
}
</style>
</head>
<body>
<?php
############################################################################
include("header.php");
############################################################################
include("menubar.php");
############################################################################
?>


<div id="main-copy">

  <?php
                 $doIncludeDS  
true// handle DS-forecast include
                 
include_once('DS-forecast.php'); ?>


</div><!-- end main-copy -->

<?php
############################################################################
include("footer.php");
############################################################################
# End of Page
############################################################################
?>

Unfortunately, due to HTML restrictions, all <style> entries have to be in the <head>..</head> area of the page, and with the include for DS-forecast.php in the <body>..</body> there wasn't a way to do that.

When DS-forecast.php is run standalone (with a valid configuration in the settings area), it will have the proper CSS.  All including() pages have to have the added CSS inserted in them to display correctly.

The good news is the tabber JavaScript is automatically emitted into the page (since <script> can appear anywhere), so there's no extra file to worry about.

Hope this helps.. I'll update the script page docs with the note about the needed CSS in including pages.
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: Theo on January 24, 2019, 02:40:02 PM
That worked perfectly, thanks again!  Great product with great support!
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: cheffy on January 26, 2019, 11:57:38 PM
Hi,

I have just installed the new darksky forecast and it working great - thanks.

I do have a question, 2 of my days in the forecast are showing night icons.  Is there a reason for this, or is this something I have done?

The link to my site is,

https://micklehamweather.com/wxforecast.php

Thanks,
Neil

Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: ConligWX on January 27, 2019, 05:43:06 AM
Neil,  looks like you are also missing a few of the icons, since they are not being displayed. if you select a town from the dropdown some of them have missing forecast icons.

Tried refreshing browser cache but it didnt make a difference.


I then seen that it seems to be your calling http:// and not https:// on the script somewhere and it was being hidden from my view. once I allowed unsafe script in chrome I was able to see the icons correctly.
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: Maumelle Weather on January 27, 2019, 08:12:23 AM
Thank you, Ken!!!!! Awesome script, Sir!!!!

Working here (https://sacrey.info/DS-forecast.php).

John
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: saratogaWX on January 27, 2019, 05:03:10 PM
Hi,

I have just installed the new darksky forecast and it working great - thanks.

I do have a question, 2 of my days in the forecast are showing night icons.  Is there a reason for this, or is this something I have done?

The link to my site is,

https://micklehamweather.com/wxforecast.php

Thanks,
Neil


For some strange and inscrutable reason, DarkSky will sometimes specify an icon=partly-cloudy-night instead of partly-cloudy-day .. I don't know why, but.. they get to pick the icon to use, I just translate it to one of the Saratoga icons (based on the NOAA/NWS set).

You do seem to be missing the newer wind_*.jpg icons from your set.  You can download https://saratoga-weather.org/saratoga-icons-addon-2015.zip and https://saratoga-weather.org/saratoga-icons-addon-2017.zip to bring your set up-to-date. Or.. the complete, current set at https://saratoga-weather.org/saratoga-icons2.zip
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: saratogaWX on January 27, 2019, 05:04:41 PM
Thank you, Ken!!!!! Awesome script, Sir!!!!

Working here (https://sacrey.info/DS-forecast.php).

John
Nicely styled, John.  I like your presentation.
Best regards,
Ken
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: cheffy on January 28, 2019, 12:49:17 AM
Quote
For some strange and inscrutable reason, DarkSky will sometimes specify an icon=partly-cloudy-night instead of partly-cloudy-day .. I don't know why, but.. they get to pick the icon to use, I just translate it to one of the Saratoga icons (based on the NOAA/NWS set).

Thanks for the explanation Ken.

I have also updated my icons.

Neil
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: ConligWX on February 07, 2019, 08:33:02 AM
I getting an issue with this script on the wxforecast.php page where meteoalarm is showing two alerts, when I click on the alerts it takes me to the Northern Ireland page but there are NO warnings.

my own script in the dashboard shows no warnings too so where is DS-forecast getting the information from?

 [ You are not allowed to view attachments ]

 [ You are not allowed to view attachments ]

 [ You are not allowed to view attachments ]

Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: saratogaWX on February 07, 2019, 11:38:30 AM
The bottom of the DarkSky forecast page shows the sources of the data for that forecast.  For Europe, I believe that Meteoalarm.eu data is used, BUT I don't know how often they collect that data and insert it into the forecast for that point.  For the USA, they use the NOAA/NWS, for Canada they use Environment Canada.  I'm not sure what they use for the other countries.
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: ConligWX on February 07, 2019, 03:36:13 PM
I take it then there is no way of turning this off.

its ok I removed the alerts section of Darksky since it doesnt work
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: saratogaWX on February 07, 2019, 04:40:03 PM
I'm sorry there wasn't a built-in switch to turn off display of the warnings.  You can suppress them by changing
Code: [Select]
<?php
  
if ($DSforecastwarnings <> '') {
to
Code: [Select]
<?php
  
if (false and $DSforecastwarnings <> '') {
as the easiest disable in the current codeset.
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: mkutche on February 07, 2019, 07:21:58 PM
http://gosportwx.com/wxdsforecast.php (http://gosportwx.com/wxdsforecast.php) the text looks like it over laps how would i fix this?
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: saratogaWX on February 07, 2019, 08:41:06 PM
Can you post an annotated image of what is overlapping?  I'm looking at your page now, and I'm not seeing any overlaps...
Title: Re: DarkSky forecast script - multilingual for standalone/Saratoga templates
Post by: mkutche on February 07, 2019, 10:56:11 PM
I'm not seeing it either now.. If I see it again i will post.