Puppy now has a home-grown weather forecast utility!

Business software, financial software, etc.
Message
Author
musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

Puppy now has a home-grown weather forecast utility!

#1 Post by musher0 »

Aug. 13, 2016, 20:35 EDT:
The latest version can be found here.

~~~~~~~~~~~
Hello all!

As the title says: "Puppy now has a home-grown weather forecast utility!" :)

This home-grown utility is intended to be useful to travelers and business people,
but also to regular users who wish to follow the weather in their vicinity.

Many thanks are due to the contributors, "ideamen" ;) and testers on this project:
Argolance, gcmartin, Médor, pelo, Pete and vovchik. (Also me, but I don't count!)
:)

Please see here. The description in English is past the middle of the post.

We feel we have a very efficient beta at present, and we're considering the
finishing touches. Any constructive suggestion is welcome, this is your chance if
you have ideas on the subject.

Enjoy! :D
Last edited by musher0 on Sun 14 Aug 2016, 00:36, edited 1 time in total.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
davids45
Posts: 1326
Joined: Sun 26 Nov 2006, 23:33
Location: Chatswood, NSW

Historical Average Temperatures?

#2 Post by davids45 »

G'jour musher0,

Listening to rain falling outside, I'm interested in your group effort. If only we had an App to control the weather - be active not passive :lol: !

But I'm not clear on what files are needed to run your package and where these are in your 18-page thread. Could you list these together for slow learners like me?

As you seem to be adding lots of weather details from various sources and places, I wondered if there is a data base for the historical average day-night or max-min temperatures for major cities or similar?
Winter here is running about 5 degrees "above average" at night (the overnight minimum) but only about 3 degrees warmer during the day (the maximum). These are real degrees (C) not fake (F) degrees :wink: .

Quite nice...when it's not raining.

David S.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#3 Post by musher0 »

Hi Davids45.

Thanks for the nice comments.

Regarding how to get the script:
First, you need to download and install the pet archive of the complete less utility --
from here:
http://murga-linux.com/puppy/viewtopic. ... ost#913475
-- unless you've already installed it on your Puppy.

Second, you need to download and install the attached pet archive (please see
below) which contains the weather script proper. It is the latest version as of
today.

Any problems, please let me know.
~~~~~~~~

Regarding variations in temperature and so on here and there in the world:
to find answers to those questions, you may want to use a good Internet search
engine. I am NOT a weather expert. I am only an amateur Puppy developer!

In particular, wikipedia: I believe that its articles for each major city and/or
country offer a table of average rainfall and temperatures towards the bottom, before
the article notes and references.

BFN.
Attachments
WorldWeather-2.7c9.pet
Please use this one. A typo in the main script in the pet put here previously prevented
the update function from working properly. Sorry for the inconvenience.
(124.73 KiB) Downloaded 676 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
davids45
Posts: 1326
Joined: Sun 26 Nov 2006, 23:33
Location: Chatswood, NSW

First try - Nothing displayed after location chosen?

#4 Post by davids45 »

G'jour musher0,

I've installed the pets you advised above in a DPup Wheezy (Full) .

The less.pet didn't have a .packages list so I hope it's there. There is a file in /usr/bin that looks like it is the main file for less.

The Weather icon is on my desktop and in the right click menu under Business.

Starting up by clicking the desktop icon, Weather-in-the-World looks OK - I navigate to Asia->Australasia->Sydney, the dialog box disappears, then nothing for a second or two, then the location selection menu re-appears.

Is something missing in what I'm doing?

David S.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

Re: First try - Nothing displayed after location chosen?

#5 Post by musher0 »

davids45 wrote:G'jour musher0,

I've installed the pets you advised above in a DPup Wheezy (Full) .

The less.pet didn't have a .packages list so I hope it's there. There is a file in /usr/bin that looks like it is the main file for less.

The Weather icon is on my desktop and in the right click menu under Business.

Starting up by clicking the desktop icon, Weather-in-the-World looks OK - I navigate to Asia->Australasia->Sydney, the dialog box disappears, then nothing for a second or two, then the location selection menu re-appears.

Is something missing in what I'm doing?

David S.
Hello David.

Thanks for the feedback. Feedbacks are always appreciated.

The location selection menu is supposed to re-appear after the data is displayed
in a panel such as the attached.


I thought I'd make the menu re-appear because travelers often want to compare
the weather at their destination with the weather in the city in which they are now.

Otherwise the user would have to click a second time on the program icon or
worse go through the entire jwm menu to get a weather report for another city.

I understand your comment as :
"The weather report for Sydney, Australia, is not being displayed at all. The menu
just recycles on itself when the user clicks on the word 'Sydney' in the menu."
Is my understanding correct?

Thanks in advance for this additional information.

BFN
Attachments
Sydney_Australia_2016-07-20.jpg
This is what I'm getting.
(67.68 KiB) Downloaded 950 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#6 Post by musher0 »

Hello again David.

If the weather report for Sydney is not showing, it may be because the wttr.in site
that provides the weather report is under heavy load at that particular moment. It
does not happen often, but it does.

The little team and I are working on providing fall-back data from an alternate site
in case the main site is overloaded. But that function is not quite ready yet.

In the meantime, if that happens, re-try half an hour later?

BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
davids45
Posts: 1326
Joined: Sun 26 Nov 2006, 23:33
Location: Chatswood, NSW

More of a Less problem?

#7 Post by davids45 »

G'jour/G'day musher0,
(Trying to be bi-lingual for you, in an Australian way :wink: )

I happened to be in a Frugal Vivid Pup when I logged on to see you'd replied (twice).
So I tried installing the two .pets in this VividPup but only got as far as a failure to install the less pet.
Does the screen shot from Vivid help?

I was concerned with no root/.package files showing for less in my first test in a Full Wheezy. Maybe pemasu's Dpup Wheezy didn't display the Vivid message but likewise it did not install less.
Is less the package that does the graphics after selecting the location?
In Wheezy, I'd seen the dialog boxes to pick a place but, as you suspected in your first reply today, I see no reports for Sydney, or anywhere (I had tried Auckland then Ottawa, with the same no-report).

David S.
Attachments
capture4220.png
(10.17 KiB) Downloaded 915 times

User avatar
drunkjedi
Posts: 882
Joined: Mon 25 May 2015, 02:50

#8 Post by drunkjedi »

try http://wttr.in/Sydney in a browser or in terminal

Code: Select all

curl wttr.in/Sydney
just to check if that's working from your machine.
Then maybe look at that program.

ASD

#9 Post by ASD »

I have had only limited success in properly understanding the output.

The first picture might represent "now" as of the most recent update, but if so, there is no indication of when last updated or how often updated. Also, sometimes the reading shows a range of temperatures.

Morning, Noon, Evening and Night might be consecutive six hour periods starting from 6 am?

When no rain (or, perhaps, an insignificant amount) is forecast why is the chance of that lack of precipitation always 0%?

My preference is for imperial, rather than metric, units and I did read this is easily done by adding ?u. As with
http://wttr.in/Sydney?u

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

Re: More of a Less problem?

#10 Post by musher0 »

davids45 wrote:G'jour/G'day musher0,
(Trying to be bi-lingual for you, in an Australian way :wink: )

I happened to be in a Frugal Vivid Pup when I logged on to see you'd replied (twice).
So I tried installing the two .pets in this VividPup but only got as far as a failure to install the less pet.
Does the screen shot from Vivid help?

I was concerned with no root/.package files showing for less in my first test in a Full Wheezy. Maybe pemasu's Dpup Wheezy didn't display the Vivid message but likewise it did not install less.
Is less the package that does the graphics after selecting the location?
In Wheezy, I'd seen the dialog boxes to pick a place but, as you suspected in your first reply today, I see no reports for Sydney, or anywhere (I had tried Auckland then Ottawa, with the same no-report).

David S.
Hello David.

Your bilingualism attempt is much appreciated! :)

And yes, your screen-shot from VividPup does help.

I just tried to download the less+lesspile pet from the forum and I also got the
substitution from the "+" character to the "%2B" expression. I'll have to ask our
moderator Flash why the forum does that.

The no-frills hands-on solution is to change back the "%2B" expression to a "+"
character once the file is downloaded on your machine, using the rename function
in the ROX-Filer or the mv utility in a terminal.

If you choose the terminal approach, it would be:
-- open a terminal in the directory where you downloaded the file
-- then type

Code: Select all

mv -f less-481%2Blesspipe.pet less-481+lesspipe.pet
(Make sure there is a "+" but no "upper-case B" in the second file name.)

I just tried it on my Puppy with good result. I also clicked on the pet to install it,
and it didn't moan or screech! :)

So that should do it. But as I said I have to ask Flash why the forum does that.
~~~~~~~

Less is not a graphic utility. It is a text reader with many features. Please see the
less FAQ for more or type

Code: Select all

less --help

The way I use it in the script is to show the weather report after some processing
has been done to the curl download (drunkjedi's post above has the original curl
command).

The post-processing was necessary to be able to translate the original report into
French. But then I sort of backtracked, and realized that it might be useful to do
some post-processing on the original English text as well, such as adding the date
and hour when the report was taken.

That is essential, isn't !? Nobody wants a stale weather report! :)

Finally, if we set aside any language processing, one advantage of showing the
weather report through less instead of having curl show it directly in a terminal is
that, in this way, the weather display becomes a quasi-GUI window.

It's almost seamless (IMO), it becomes pretty much like a regular program window.
To me that is a huge advantage over a regular terminal display -- the idea of which
is irritating and de-motivating for many users.

~~~~~~~
About the "no /root/.packages" for less, I don't really know why. My tentative
explanation would be that by default Puppy already has a stripped-down less utility
included in the busybox series of utilities. So it wouldn't be logging a less install in
the "packages registry" a 2nd time?

The "busybox less" was so stripped-down that it was next to useless for all but the
simplest purposes. I know some newer Puppies have dropped the busybox less
and are including an older version of the real less (v. 450, I think).

In any case, you can't go wrong downloading my suggested package: the less
utility shipping in it is the real one and also the latest (v. 481), from
greenwood software.
~~~~~~~

If you have any more snafus like this, please let me know?

Have a great day! BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#11 Post by musher0 »

ASD wrote:I have had only limited success in properly understanding the output.

The first picture might represent "now" as of the most recent update, but if so, there is no indication of when last updated or how often updated. Also, sometimes the reading shows a range of temperatures.

Morning, Noon, Evening and Night might be consecutive six hour periods starting from 6 am?

When no rain (or, perhaps, an insignificant amount) is forecast why is the chance of that lack of precipitation always 0%?

My preference is for imperial, rather than metric, units and I did read this is easily done by adding ?u. As with
http://wttr.in/Sydney?u
Hello ASD.

Many thanks for your feedback.

If you are using the "Weather in the World" script, the top line should have a date
such as
On jui 21 2016, 08 h 31
. Also, the report will refresh (update) automatically every four hours.

Or even less. For example, if the first report was taken at 8 h 59 a.m., it will
update automatically if you use the script again at 12 h 01 (one minute after noon).
So the weather report will be updated between 3 hours and 1 minute and a full 4
hours, as long as there is a difference of 4 between the hour of the last report and
the current time.

It is also updated automatically at the change of date, from one day to the next.
This day update trumps the hours update.
~~~~~~~~

I'll also see what I can do to present the user with a choice of metric or imperial
units in the script.
~~~~~~~~

For the rest of your comments, I must say that I have no control over what they
are referring to. The weather report proper is the work of the people at the wttr.in
site, namely Igor Chubin. My suggestion would be that you send those comments
to him.

That said, my understanding is that morning starts a 6 a.m. Noon should actually
read "Afternoon", from noon (the hour) until 6 p.m., and evening from 6 p.m. to
midnight. The "night" is actually on the next day, from midnight to 6 the next
morning. So yes, in increments of 6 hours.

You say:
When no rain (or, perhaps, an insignificant amount) is forecast why
is the chance of that lack of precipitation always 0%?
I believe that is standard weathermen jargon. I see it on some Internet weather
sites as "POP : 0%" (POP being "Probability Of Precipitation").

I hope this helps. Bye for now.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
drunkjedi
Posts: 882
Joined: Mon 25 May 2015, 02:50

#12 Post by drunkjedi »

Hi musher,
When I posted that comment I was at work and checked in Mobile's chrome browser and curl in terminal app (yup my mobile is rooted and has terminal on it. lol)

Anyway browser method was working.
But curl gave error. (curl: (6) Couldn't resolve host 'wttr.in')

Now at home on tahr64 and in chrome and also in terminal for curl gives only one word as output "Error".
I checked in mobile again and browser method was working. curl gave same error again.

What's happening?
Any Idea?

And yes your app on tahr64 shows menu again without showing weather.
But I don't think anything is wrong with your app.
Need to find root cause of it giving error in browser and in terminal.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#13 Post by musher0 »

Hi, drunkjedi.

Well, I just got these three reports from different parts of the world, even Sydney,
Australia. It's 19:05 hrs right now, Ottawa/Gatineau time (EDT). I'm thinking that if
someone from the other side of the world can get the weather for Sydney, someone
local should get the report too.

My experience is that the site hung on me 4-5 times when I was testing it
intensively (while building the cities menu). It sounds as though the site has a
mechanism to filter out compulsive use? Just guessing, but it would make sense.

Also late at night Ottawa time sometimes I get an error or nothing at all. I try again
five minutes later and it's ok. Beats me; this one I can't explain.

Or perhaps... Midnight here means six in the morning in Europe. Almost all
countries in Europe have the same time zone. On the one hand, there are 450
millions Europeans trying to get the weather at the same time when they wake up
and on the other hand there's little old me on the other side of the Big Pond trying to
get tomorrow's weather before going to bed!

It's an exaggeration of course, but I'm sure you're getting my meaning!

BFN.
~~~~~~~~~~~~
Transl. of the "weather now" legends in the screen capture below: cloudy in
Gatineau, light rain in Cape Town and sunny in Sydney.

Moral of this story: at the time of this writing, the wttr.in site is up and the script is
working.

What more can I say? If there are thousands of people querying what looks like a
rather small site, at the same time, I'm willing to be understanding if the site fails to
respond every now and then.
Attachments
Three-reports_2016-07-21.jpg
Weather reports for Gatineau, Canada, Cape Town, South Africa, and Sydney,
Australia obtained whithin seconds of each other around 19:00 today Ottawa time (EDT). (Please pardon my French!) ;)
(45.21 KiB) Downloaded 834 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#14 Post by musher0 »

Double-check:
Attachments
Sydney-Australia_2016-07-21.jpg
(65.66 KiB) Downloaded 823 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
davids45
Posts: 1326
Joined: Sun 26 Nov 2006, 23:33
Location: Chatswood, NSW

Now reporting from Sydney (Australia's, not Canada's)

#15 Post by davids45 »

G'jour/day musher0,

Success :D !
Renaming the less file to change the "%2B" expression to a "+" and then installing that has given me the weather in the Unicorn Frugal Pup I'm using at the moment.
I'll attempt an sfs combining the two pets so all my Frugals can share this package at boot-up.

A couple of comments (minor bugs?).
Each start-up of the report has a error message about a not-fully functioning terminal (see screenshot). Pressing return and the report then displays. This may be just this Unicorn Pup - I'll see with some more Pups but I thought I should mention it just in case it's not.

The second screenshot is the full weather display following pressing <Enter> after the error message.
I notice the wind direction 'icon' is being truncated by the next piece of text (the wind speed) - if you look closely at the third screen shot I hope you see the arrowhead for the north-easterly wind/breeze is being chopped; an easterly is cut to just a dash.

Thanks for your help.

David S.

[post-postscript: I see in your just-posted images, the wind direction arrows are just about "unchopped" so it is likely my terminal is at fault? Are all terminals "equal"?]
Attachments
capture12362.png
(4.99 KiB) Downloaded 813 times
capture13771.png
(97.63 KiB) Downloaded 831 times
report_detail.png
(34.26 KiB) Downloaded 809 times

User avatar
drunkjedi
Posts: 882
Joined: Mon 25 May 2015, 02:50

#16 Post by drunkjedi »

No worries musher,

I suspected problem should be from source site.
I was not checking Sydney though, but cities from India.
Didn't test much too, only 5 tries each on PC and mobile
I will try today later.
What surprised me was mobile browser was showing consistently and PC never showed even once.

User avatar
davids45
Posts: 1326
Joined: Sun 26 Nov 2006, 23:33
Location: Chatswood, NSW

Some Pups missing libtinfo

#17 Post by davids45 »

G'day/jour musher0,

I have been trying the less & weather pets in some Full Pups.

Tahrs 5.8.4 and 6.0.2 were fine apart from the already mentioned first-click terminal error/warning message.

Wheezy (one by pemasu) and SnowPup-016 (also one of his) - nothing when trying the report but when I tried running less in a terminal, I got a missing lib message for libtinfo.so.5

Slackos 5.9.3 and 6.30 both got to the desktop weather icon and then location selector but clicking for the report, only a brief flicker of a millisecond report.

I then copied the libtinfo.so.5 from a Tahr (it was in its /lib) to my general Library archive and then copied from my archive to /usr/lib in slacko-6.3.0 and now slacko-6.30 displays the report :D - but still with the terminal error/warning requiring the <Enter> press.

So maybe non-Ubuntu-derived Pups need this missing libtinfo.so.5 for less to do its "magic"?

A minor nuisance that, in slacko, when the weather desktop icon was created, I lost my pwidgets. A Pwidgets re-run recovered the widgets without losing the weather icon.
The weather icon appears where I have my widgets (right-hand side of the display) so I'd like to have the weather icon first appear more centrally on the desktop - is there some way to re-position the first appearance of this icon to mid-screen?

I'll further check the missing library in the non-Ubuntu Pups and let you know if this is a general fix for the missing report problem in them.

Nice sunny winter's day here, but may not reach the 25C 'hottest July day for x years' forecast. But 23C is OK by me and the garden - huskies may disagree, of course.

David S.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#18 Post by musher0 »

Hi David.

Very good report thanks. I had forgotten about the libtinfo dependency and the varying
needs of "the breeds". My apologies.

It's simple as pie to put the icon back in the middle of the screen upon installation.
Will do in next edition.

We had 35 C today if we add the Humidex factor. No huskies outside here either. ;)
They took refuge where there is some Air Conditioning!

BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#19 Post by musher0 »

davids45 wrote:G'jour/day musher0,

Success :D !
Renaming the less file to change the "%2B" expression to a "+" and then installing that has given me the weather in the Unicorn Frugal Pup I'm using at the moment.
I'll attempt an sfs combining the two pets so all my Frugals can share this package at boot-up.

A couple of comments (minor bugs?).
Each start-up of the report has a error message about a not-fully functioning terminal (see screenshot). Pressing return and the report then displays. This may be just this Unicorn Pup - I'll see with some more Pups but I thought I should mention it just in case it's not.

The second screenshot is the full weather display following pressing <Enter> after the error message.
I notice the wind direction 'icon' is being truncated by the next piece of text (the wind speed) - if you look closely at the third screen shot I hope you see the arrowhead for the north-easterly wind/breeze is being chopped; an easterly is cut to just a dash.

Thanks for your help.

David S.

[post-postscript: I see in your just-posted images, the wind direction arrows are just about "unchopped" so it is likely my terminal is at fault? Are all terminals "equal"?]
Hello again, David.

It's good to hear that you finally met with success! :)

~~~~~~~~~~

About the arrows with chopped heads in the terminal, this is the first I've heard of
such a bug, so I don't know what to tell you.

Are all terminals created equal? After reading your account, I'm not sure anymore.

I chose to include the st terminal in the package because our default urxvt was
"absorbing" (intercepting, or not showing) a lot of the ANSI colors in the wttr.in
weather report. Now if there's a problem with st... what else to use?

Other things I see as possible (to investigate, but not necessarily probable):
-- an incomplete or faulty character set in Unicorn Pup?

-- what typographers call "kerning", the spacing between the characters. I know "of
it": there is something like a virtual Linotype in every OS, that sees to it that the
characters of a text are equally and clearly separated. You can play with that kerning
a little in word processors. But in the console? I thought the user's choice of font
took care of that.

Weird.

On the other hand, if you're talking of terminals in the sense of monitors, then no,
they are not created equal. Quality of monitors can and does vary widely.

Sorry I couldn't be of more help on this subject.

BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
davids45
Posts: 1326
Joined: Sun 26 Nov 2006, 23:33
Location: Chatswood, NSW

Further testing in Other Pups

#20 Post by davids45 »

G'day/jour,

I have now copied the missing libtinfo.so.5 to a number of different Pups.

Precise looks OK now, also PupJibaroJessie.

Slackos are also fine with the Tahr-derived libtinfo.so.5.

In PupJibaroWheezy, nothing happened so I tried running less in a terminal and got a 'Missing file' message that I don't understand - see screenshot. What file is missing?

In SnowPup, I saw a message about the wrong glibc - not surprising as this is a kernel-2.xxx Pup.

In DPupWheezy with a 3.5.2 kernel, after less gave the enigmatic above 'missing file' message from the terminal, I ran wttr.in.sh in the terminal and had another glibc message (screenshot).

I may need to explore the LIBRARYPATH option for the affected files?

Why I need as many weather apps as I can get:
:oops: I was wrong again (see my previous post)! Looks like we had 26+C today - so I gave my car its annual "whether it needs it or not" wash. Back to cold for the weekend by the looks of the forecasts :( .

David S.
Attachments
DPupWheezy_wttr_terminal.png
(22.74 KiB) Downloaded 578 times
Screenshot_less_pupjibarowheezy.png
(22.02 KiB) Downloaded 590 times

Post Reply