Yweather 0.1a - taskbar weather app

Window managers, icon programs, widgets, etc.
Message
Author
User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

Yweather 0.1a - taskbar weather app

#1 Post by vovchik »

Dear puppians,

I just finished coding a little taskbar app that shows weather in the taskbar. You need to launch it with a valid WOEID (look up at http://woeid.rosselliot.co.nz/) and a system of units (either "c" for metric or "f" for English).

Example: yweather 551801 c

This will give you a report for Vienna, Austria. Left clicking updates the report and taskbar icon. Right clicking shows a menu and lets you quit. I have put two sample scripts in /usr/local/bin for New York City and Vienna which will show up in the Personal menu. Once you have selected your location, you can modify the desktop files in /usr/share/applications to reflect your preferred locations. You can also place the example scripts in your /root/Startup directory, so that the weather reports are available in your taskbar when you start your system (or restart X). Yweather relies on Yahoo's weather API.

I have attached a pet compiled in Lucid that should work in most recent puppies. The source (written in BaCon) is also attached. The binary, stripped and upx'd, weighs in at only 14k.

Have fun.

With kind regards,
vovchik
Attachments
Yweather-0.1a-Lucid.pet
(41.43 KiB) Downloaded 1467 times
yweather.png
(49.01 KiB) Downloaded 3115 times
yweather-0.1a-src.tar.gz
(6.39 KiB) Downloaded 1300 times
Last edited by vovchik on Mon 07 Jan 2013, 14:35, edited 1 time in total.

User avatar
666philb
Posts: 3615
Joined: Sun 07 Feb 2010, 12:27
Location: wales ... by the sea

#2 Post by 666philb »

nice little app ... thanks vovchik
Bionicpup64 built with bionic beaver packages http://murga-linux.com/puppy/viewtopic.php?t=114311
Xenialpup64, built with xenial xerus packages http://murga-linux.com/puppy/viewtopic.php?t=107331

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#3 Post by seaside »

vovchik,

What a handsome product. I tried it out on Puppy Precise 5.4.1 and it ran nicely.

It must be your new year's resolution, to see if you could meet the challenge of parsing all that xml data, and maintain a good humour. :D

Thanks for this very pleasing applet.

Best Regards,
s

User avatar
ally
Posts: 1957
Joined: Sat 19 May 2012, 19:29
Location: lincoln, uk
Contact:

#4 Post by ally »

runs ok on slacko 5.3.3 too.....

:)

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

If only it could control the weather....

#5 Post by davids45 »

G'day vovchik,

As I sit here in Sydney waiting for the temperature outside to get to the forecast 43C, your task-bar weather app sounded interesting.

Running a Full Slacko-5.4 (4G so non-PAE), I downloaded and started up yweather in the console (yweather 1095024 c) but was told of a missing lib file -> libgobject-2.0.so

Accidentally copying the almost right file libgobject-2.0.so.0 to /usr/lib gave me a segmentation fault.

Copying the right file ( :oops: ) libgobject-2.0.so to /usr/lib and the app now works.

And it's only 37C..... so far.

Thanks,
David S.

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

#6 Post by davids45 »

G'day again vovchik,

I added a script to Startup to get yweather running at boot-up in Slacko-5.4, which it did.

But I can't get yweather to update with a left button click when the cursor is over the sun icon on the task-bar. The yweather display pop-up is for noon here (was 37C) but it is after 1pm now and it's gone past 39C outside (confirmed by the weather pwidget).

A mouse right-click on the sun icon just brings up the same noon-time weather details - no menu as suggested in the pop-up?

Just did the same thing (installed the .pet and set my location and metric preference from the console) in my Full Exprimo-5.x.?-3.6.2 and yweather worked first time - no missing libraries - and mouse-clicks show as promised. I then put the run-it-at-booting script in Startup and re-booting also displayed the now 42C temperature at 2.20pm, etc without problem.

How often does the Yahoo weather information update, by the way?

David S.

User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

#7 Post by mavrothal »

Dear vovchik,
Tried the pet in (a bit modified) precise 5.4.3 and although I get the tray icon OK, it renews and quits OK in left- and right-click, I can not get any text to display on hover. Terminal shows

Code: Select all

(yweather:540): Gtk-WARNING **: Failed to set text from markup due to error parsing markup: Error on line 7 char 37: Element 'markup' was closed, but the currently open element is 'b'
What do I miss?

Latter Looks like is something in the handling of Yahoo provided data for some locations. Tried another location and it behaves OK.
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

#8 Post by vovchik »

Dear mavrothal,

I also notice a few sites that gave the same result. I haven't yet checked out those xml files that I am receiving in any detail, but suspect that there is something dicey in the raw data where nothing displays and the terminal shows bad markup. I will look into that. Can you give me the woeid of the site that was bad? Yesterday, the Buenos Aires data showed normally. They day before, I got the kind of result you describe for your location. I think I can solve that problem by looking at the "bad" data and figuring out what might be "bad". For 99% of the WOEIDs I have tried, yweather does work, though.

With kind regards,
vovchik

User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

#9 Post by mavrothal »

vovchik wrote:Can you give me the woeid of the site that was bad?
Unfortunately no, because they are not "bad" anymore.
I have the sense that some "rare" locations may give "bad data" if the server does not have them handy/cached and needs to find/generate them on the spot.
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

#10 Post by vovchik »

Dear davids45,

I don't really know how often sites report their data to Yahoo, although I think it varies from location to location. the "Last weather update" line is the last update that Yahoo has.

With kind regards,
vovchik

PS. Grab the latest pet. In the help (right click), in the first version posted (and 8 downloads by then), I confused right and left click. I genuinely cannot distinguish between right, and left and have to look at my hands for a few seconds for that distinction to sink in. :)

User avatar
nilsonmorales
Posts: 972
Joined: Fri 15 Apr 2011, 14:39
Location: El Salvador

#11 Post by nilsonmorales »

works fine with passaggio( tint2 )puppy , just add sleep 4 in script startup for my country :) have you NLS for spanish?
Image

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

#12 Post by vovchik »

Estimado nilsonmorales,

Lamentablemente yo hablo solamente un poco de Español :( Si tu quieres hacer una traducción? Te podria ayudar a hacer una compilación en Español excepto que ahora no tengo ni el tiempo ni el conocimiento .

Atentamente,
vovchik

tenochslb

spanish translation NOT COMPILED

#13 Post by tenochslb »

spanish translation sources
Attachments
yweather3.png
(33.89 KiB) Downloaded 2802 times
yweatherspanish.tar.gz
(5.34 KiB) Downloaded 968 times
Last edited by tenochslb on Wed 16 Jan 2013, 13:46, edited 2 times in total.

tenochslb

#14 Post by tenochslb »

Using wary 5.3

Compilation fails on line 1 when running 'bacon yweather.bac'
Parse error

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

#15 Post by Geoffrey »

This works in Carolina 005, though two symlinks need to be made

Code: Select all

ln -s /usr/lib/libgobject-2.0.so.0.3200.1 /usr/lib/libgobject-2.0.so
ln -s /usr/lib/libgtk-x11-2.0.so.0.2400.8 /usr/lib/libgtk-x11-2.0.so
[b]Carolina:[/b] [url=http://smokey01.com/carolina/pages/recent-repo.html]Recent Repository Additions[/url]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

#16 Post by vovchik »

Dear tenochslb,

The reason your compilation fails is that you are using an older version of BaCon. Newer versions support C-style comments and that is what there is in line 1. Grab build 28 from basic-converter.org and compile it and replace the older version with the new one.

With kind regards,
vovchik

@ Geoffrey:

I think Carolina should have had those symlinks to start with. They are standard in almost every distro. :( Thanks for point out that little problem.

tenochslb

#17 Post by tenochslb »

Dear tenochslb,

The reason your compilation fails is that you are using an older version of BaCon. Newer versions support C-style comments and that is what there is in line 1. Grab build 28 from basic-converter.org and compile it and replace the older version with the new one.
I just erased those lines and compiled :D I did polish my translation I will update. Is there a way to retrieve the information in spanish because that would be the only thing missing to have a complete translated software.

Thanks.

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

#18 Post by vovchik »

Dear tenochslb,

I changed the prog entirely to Spanish and had help from a friend from Colombia who visited me a few days ago. Unfortunately, yesterday that disk crashed along with the source code and now I am trying to rescue that partition. It just crashed out of the blue. In any case, I have the translations of the description codes as provided to Yahoo developers in English and my Spanish translation on paper! So it is merely to write that little routine again. It is all done, but, I am now on a bad laptop without a recent GTK, so I cannot compile the BaCon program on it since it doesn't like markup in tooltips. I hope to have my normal computer up and running soon....

With kind regards,
vovchik

User avatar
Eyes-Only
Posts: 1043
Joined: Thu 10 Aug 2006, 06:32
Location: La Confederation Abenaquaise

#19 Post by Eyes-Only »

Gee whiz vovchik! Sorry to have read about your recent troubles with your hard drive crashing! :( I know only too well about computer problems as this is why I have been absent many months from the forum - my motherboard burnt out so badly I needed another machine. I was very lucky in that a friend of mine heads the computer department of the local school system... they are changing to new computers and I was given an older one by him FREE! :shock: And this machine is three times the computer that my older one was! :)

I wished that we were neighbours vovchik as then I would have you come over to my house to go through my "spare parts" bin. I'm sure that you would easily find two or more hard drives to replace the one that you had lost. After all, you've been a good friend to me here who has helped and encouraged me greatly many, many times. :)

Good luck my friend! -sigh- I wished I could help.

Amicalement/Cheers,

Eyes-Only
"L'Peau-Rouge"
*~*~*~*~*~*
Proud user of LXpup and 3-Headed Dog. 8)
*~*~*~*~*~*

keniv
Posts: 583
Joined: Tue 06 Oct 2009, 21:00
Location: Scotland

#20 Post by keniv »

Hello All

Working here in lucid 528. Have tried to run it at start up by using the following script in an executable file called startyweather.

#!/bin/sh
/usr/local/bin/yweather 27730644 c

I have also tried

#!/bin/sh
/usr/bin/roxterm -e /usr/local/bin/yweather 27730644 c

I have it in /start but this does no work at start up. However if I click on this file after boot up it works fine. Don't know enough about this to know what I am doing wrong. I now start it using a desktop icon.

Nice little application. Thanks for this.

Regards,

Ken.

Post Reply