The script now has support to format the date in your preferred style from the WXSIM issued date. It also will allow translation of the city name from the WXSIM output into the desired language (if needed).
A new ‘dateformat’ line can be added to the plaintext-parser-data.txt (and to the plaintext-parser-lang-XX.txt files to override the default set in plaintext-parser-data.txt). The included sample formats include US, European and ISO format dates. You’re free to invent your own if you like (and are careful with the syntax )
Included formats
# select default date format by putting a '#' in front of the ones NOT to be used.
# The last uncommented one
# in this file will be used for the date format .. it may be overridden by a dateformat
# entry in the plaintext-parser-lang-XX.txt file.
#
dateformat|d-M-Y h:i a| // USA format 31-Mar-2006 02:03 pm
#dateformat|d/m/Y H:i| // Euro format 03/31/2006 14:03
#dateformat|Y-m-d H:i| // ISO format 2006-03-31 14:03
The display on the output will appear with the translated day of the week before the date.
If omitted, the date will format per USA convention as dd-Mon-yyyy hh:mm am/pm
Ken might it be worth adding an option to not print the doctype, head and body html when using the full forecast. I wanted to use the full forecast in my page but did not want to specify all the code to include it all so I just commented out these sections in the code, not doing this means duplicate doctype etc and fails validation.
Ken any chance you might consider adding wind speed and direction to the icon summary part? A big gripe I have with the TV weather over here is they dont provide wind speed or direction all the time, where I live on the coast it plays a big part in peoples plans. I think most people are likely to only look at the top summary rather than read the full text, so providing an indication of wind speed (ave not gust generally, perhaps a gust of over a threshold)) and direction (a simple arrow perhaps) would IMHO improve the display considerably.
Jack,
The PoP filter only deals with ‘Chance’ (of rain) and displays the sky icon with PoP stamped. For frozen stuff, the PoP is displayed on the icon for rain/snow, snow, ice, freezing rain, etc. The NWS uses >40%PoP as ‘Likely’ so it’s displayed on the Rain icon set.
Stuart… good idea. I’ll see what I can do about adding the Wind info (Icon, direction abbreviation, units) as a new variables parsed from the plaintext. I’ll make it optional to display the line with wind based on a setting in the script.
Plese keep in mind that for example in the US I believe the arrow is pointing into the wind but in Europe it is pointing the direction it travels (i.e. US and EU wind arrows are opposite of each other) or at least that is my feeling when I see the wind “arrows” in the graph outputted from wxswim, they point into the wind as opposed to with the wind as we need here…
Just noticed something in the code for the plaintext-parser.php file… it doesn’t handle the UV when it is equal to ‘11’, rather it looks for when it is > 11… I’m not sure if this is right, but I changed the line in the code to now read:
case (($uv >= 11) ):
I believe 11 and above are all considered extreme?
Easy way round this. Make it a wind rose display with the angle of the line(s) indicating direction(s) and the length of the line(s) indicating the intensity.
This kind of thing may be a starting point. In addition to the length of the line(s), colour could be added, e.g., green for <2 m/s, yellow for <4 m/s and so on.
I think we may get confused here between what a wind vane show and what is normal on forecasts. I think you will find that most forecasts have the arrow pointing the way the wind is blowing, but all wind vanes point into wind (its the way they work ). MML shows wind arrows pointing the way the wind is coming from and that seems acceptable to all. I think in general a wind rose always shows the wind in the direction it comes from.
You are quite correct so does mine, I totally b******d up my above post on that :oops: :oops: Must learn to read what I actually wrote and not what I thought I wrote. Did not help that I was having my ear bent by ‘her indoors’ while writing it
However what I said about a wind rose and a wind vane still stands.
When I add the wind arrows to plaintext-parser.php, I’ll make sure to use the convention of “where it’s blowing from” (just like the AJAX arrows in the carterlake templates use).
It may be a bit before I add them… the wife and I are off to Europe on the 10th of April and there’s lots of packing to do. We’ll be in the UK, Denmark, Netherlands and Germany on our one-month stay, so programming will be only when something really breaks, or we’re tired from touring/walking and will be slumming in our hotel(s) or at our friends houses in Denmark and Germany.
I hope to meet up with doornenburgweer and jwwd when we’re in their neck of the woods.