Yahoo Weather theme

Karamba & Superkaramba

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

2
Score 46.0%
Description:

Yahooweather is no longer a modification of "Another Weather Theme 1.0". Only the php code to get the weatherdata is based on this theme. All other stuff are rewritten. This because I wanted the following issues:
- the php code was called for every bit of data. So older versions called the php code 20 times for every update. This is reduced now to 1 call per update.
- The theme had problems finding itself so people had to manually correct the paths in the source.

What is new:
- added a shell script that deals with the paths and calls the php code.
- added python script to make better use of karamba. (I had to learn python for this! e.g. this is actually my first ever written python script)
- cleaned the theme file.
- The theme will create a folder in the system temp (/tmp) called YahooWeather where it will store a data file, the downloaded html and log file if needed.
- At this moment the yahoo url is defined in the shell script. This will change in the future.
/* ------------ */
This is a modification of the "Another Weather Theme 1.0" that can be found here: http://www.kde-look.org/content/show.php/Another+Weather+theme?content=101180

Added: - temperature display
- Five day forecast
- Location

Change the url in the "weather.php" file to match your location.
Last changelog:

9 years ago

- Problems with the paths are now solved I hope. (06-11-2010)
- Using less resources from the system.

- Yahoo changed its code again, so small update. (18-07-2010)
- Today (14-12-2009) Yahoo changed the code on it's weather page again. Modified the script so it works again.
- Today (12-11-2009) Yahoo changed the code on it's weather page. I had to modify the script to make it work again.
- Repacked the archive so it can be installed as archive by karamba.
- Changed paths to "themes" folder.

xdunlapx

7 years ago

Download link is broken.

Report

Farsaj

7 years ago

Cannot download

Report

denisp

9 years ago

All I've got on my desktop is :

Max:
Min:

any idea about what's happening ?
Thanks

Report

C

merciful

9 years ago

Try to execute the file "weather.php". It should produce a output similar to this:

eabe@eabeacer:~/.kde/share/apps/superkaramba/YahooWeather$ php ./weather.php
weatherpics/20n.png
8 C
12 C
6 C
Leeuwarden
Tonight:
6 / 12
weatherpics/29s.png
Tomorrow:
7 / 11
weatherpics/9s.png
Mon:
7 / 12
weatherpics/30s.png
Tue:
8 / 12
weatherpics/11s.png
Wed:
9 / 12
weatherpics/24s.png


If it does not, check your php installation. If it does, check the paths and correct them if needed.

Php should be at php5. I'm using this one:
PHP 5.2.13 (cli) (built: Mar 28 2010 20:43:45)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies

This comes with Slackware 13.1

Report

denisp

9 years ago

Hi Merciful,

thanks for your answer.
I installed php5-cli.
checked php which is a symlink to /usr/bin/php5.

php ./weather.php gives me :

weatherpics/28d.png
11?C
15?C
8?C
Redon
Today:
8 / 15
weatherpics/11s.png
Tomorrow:
10 / 16
weatherpics/30s.png
Tue:
11 / 17
weatherpics/28s.png
Wed:
11 / 17
weatherpics/30s.png
Thu:
10 / 16
weatherpics/28s.png

but still no display except :
max:
min:

Regards,



PS : this is on a debian squeeze system

Report

C

merciful

9 years ago

In the files YahooWeather.pl & YahooWeather.theme check if the paths correspod to your actual path. Correct the paths in these files if needed!

Report

denisp

9 years ago

I checked the pathes : indeed there were two problems :
- I'm using trinity that is continuing kde 3 branch, so the config directory is ~/.trinity, not ~/.kde
- the directory where the theme files are located is
.../superkaramba/themes/YahooWeather-1/YahooWeather-1.3

and not
.../superkaramba/themes/YahooWeather-1

So I did the changes, but it still does not work. But I wonder if there is not another problem : the files are called pogoda.pl and pogoda.theme, not YahooWeather.pl and YahooWeather.theme as you said.

Regards,

Report

C

merciful

9 years ago

You can also try to change paths to the absolute paths e.g. /home/<username>/.kde/share/apps/superkaramba/YahooWeather/

If nothing is displayed and you get info from weather.php, the theme can't find the .pl file or the .pl file can't find the weather.php file.

Eabe

Report

denisp

9 years ago

Sorry, I forgot one last problem.
I've got two squares instead of ° for temperatures. Is UTF8 supported ?
Thanks

Report

denisp

9 years ago

OK, now it works, but I had to do 3 things for that :
1) like you said, replace ~ by /home/denis in pogoda.theme
2) add "#!/bin/sh" at top of pogoda.pl (It looks strange since pl should have meant that it was a perl file, but it works)
3) chmod +x pogoda.pl

Thanks for your help

Report

C

merciful

9 years ago

in the .pl and .theme file change the paths to ~/.trinity/share/apps/superkaramba/themes/YahooWeather-1/YahooWeather-1.3/

or if this is not the correct path, to the real path.

Filenames doesn't matter really. I'm using a modified version that will be available soon.

Eabe

Report

MoonBlossom

9 years ago

Try installing php5-cli or php-cli

Report

nottinhill

9 years ago

Above goes if you install manually.

Installing from Karamba Menue works without alteration of files.

I fixed the issue with installing PHP-CLI. For SuSE it might be worth noting that this equals to PHP5. The Yahoo PNG are great, Thank you for the app!

Report

nottinhill

9 years ago

As for weather.php and pogoda.pl it has already been noted that they are messed up. A quick looks into pogoda.theme shows that it is also messed up thoroughly. All hardlinks go to wrong YahooWeather-1 Directory and not updated -1.2 directory. Also .kde might not work for .kde4 folders.

I fixed the 3 messed up files (that is 100% of the program!), but it still is not working. Anymore ideas? I use KDE4.3.5. I see only min/max font.

Report

kuchumovn

9 years ago

hi,
so how can i install it?
(I'm using Kubuntu 9.04)

Report

Grindcore

9 years ago

Check that you have the following packages installed:

superkaramba
plasma-scriptengine-superkaramba

Afterwards you should be able to install the file (choose Superkaramba in the dialogue).

Report

C

merciful

9 years ago

Hi,

You should be able to install it from within Karamba.

But you can also extract it and place it in this path:
Quote:~/.kde/share/apps/superkaramba/themes/YahooWeather-1/

Eabe

Report

astreaapn

10 years ago

replace this

# Echo stuff to calling app
echo $image."\n";
echo $temp."�C\n";
echo $max."�C\n";
echo $min."�C\n";

to

# Echo stuff to calling app
echo $image."\n";
echo $temp."°C\n";
echo $max."°C\n";
echo $min."°C\n";
echo $place."\n";

Report

C

merciful

10 years ago

Hi,

I only see this:

# Echo stuff to calling app
echo $image."\n";
echo $temp."°C\n";
echo $max."°C\n";
echo $min."°C\n";
echo $place."\n";

The question mark symbols from your example, I don't get here. Probably something with font or code page I guess.

Eabe

Report

C

merciful

10 years ago

Even on the console (Slackware / Nano) it looks all fine. What app are you using?

Eabe

Report

C

merciful

10 years ago

Only if I open the file with KWord, I get the same result as you.

The file is a plain text file. The best way to edit this file is using a text editor like KWrite, Kate, Nano or Vi.

Eabe

Report

astreaapn

10 years ago

Thank you for answering.
The problem is fix with the change of symbol posted before.

Report

astreaapn

10 years ago

send me a screenshot of that.

Report

C

merciful

10 years ago

Just send you a screenshot :-)

Report

9 years ago

- Problems with the paths are now solved I hope. (06-11-2010)
- Using less resources from the system.

- Yahoo changed its code again, so small update. (18-07-2010)
- Today (14-12-2009) Yahoo changed the code on it's weather page again. Modified the script so it works again.
- Today (12-11-2009) Yahoo changed the code on it's weather page. I had to modify the script to make it work again.
- Repacked the archive so it can be installed as archive by karamba.
- Changed paths to "themes" folder.

12345678910
1
product-maker dejan034 Jan 21 2011 3 bad
product-maker Base: 4 x 5.0 Ratings
trollonrent
Nov 27 2011
MoonBlossom
May 22 2010
File (click to download) Version Description Downloads Date Filesize DL OCS-Install MD5SUM
*Needs ocs-url or ocs-store to install things
Pling
0 Affiliates
Details
license
version
1.9
updated Nov 06 2010
added Sep 28 2009
downloads 24h
0
pageviews 24h 4