Karamba Weather.COM

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

0
Score 50.0%
Description:

A Karamba Weather Theme,

note: in the time I wrote this, there wasn't any *good* weather karamba theme. Now, we are plenty of them.

I'd be glad if somebody uses it besides me!

This scripts collect info from http://www.weather.com

Please, follow directions in README to show the weather at your city.

Enjoy!!!
In short time, I'd realease a script in Spanish.

Please, check md5sum of the file
3dd96faef837a0a674e76d4a09af5203
karamba_weather.tar.gz

aiiee

9 years ago

dead. stillborn. never worked. why is this here?

Report

askoning

14 years ago

Changing the $url line in the script to $url = "http://www.w3.weather.com/outlook/travel/local/" . $cityCode . "?";
works for me. (This is where one finally ends up after 3 normally unseen redirections.)

Report

janet

14 years ago

Is there any solution in the meantime? I too only have the backgroundpanel...

Report

AussieJohn

14 years ago

Still nothing but background. Carefully edited as per ALL of your instructions.
Using Mandrake10.OE. Have tried 8 times without success.

John

Report

AussieJohn

14 years ago

I read some of your other comments about solutions including one about perl.

I am sorry but you are too vague to be of any help to most people which is a shame considering that judging by your screen shot, you have the most attractive panel.

John

Report

axialix

14 years ago

Same here, no icons, just the background.

Report

elegos

14 years ago

me too... only the background image...

I'm italian, I live in Milan..

So I changed the code to

$cityCode = "ITXX0042";

and nothing... so I also tried to change this:

$url = "www.weather.com/outlook/travel/local/" . $cityCode;

but nothing...

Report

hosti

15 years ago

I get only the background image, no text, no icons, nothing.

Any suggestions ?

Report

uteck

15 years ago

I added w3 to url to make the perl errors go away so it displays the weather, but there are no icons.

Report

uteck

15 years ago

I get this error when I start it from a differnet directory.
Can't open perl script "script/climaEn.pl": No such file or directory
Config File ~/.superkaramba/weather.rc written.
TypeError: reload() argument must be module

Report

laktose

15 years ago

Whenever I load karamba weather it just shows the source code of weather.com with Ithaca,NY at the head until i refresh like 8 times...
is there any way i can fix this?

Report

sp00k113

15 years ago

Try deleting the corresponding karamba *.rc file?

Report

Dany303

16 years ago

When i start the weather theme with Karamba, i see the baground, but i dont see any Information!


my script:
#!/usr/bin/perl
#usage: perl /usr/share/karamba-0.17/themes/karamba_weather/script/clima.pl www.weather.com/weather/local/BLXX0006
use LWP::UserAgent;
use HTML::TokeParser;

#City code according to http://www.weather.com, please check the small README
$cityCode = "GMXX0131";
$url = "www.weather.com/outlook/travel/local/" . $cityCode ."?&setcookie=1";
#my $url = @ARGV[0];
my $ua = new LWP::UserAgent;

$url = "http://$url" unless($url =~ /^http:\/\//);

if($ENV{'http_proxy'}){
$ua->env_proxy;
$ua->proxy(http => $ENV{'http_proxy'});
}

my $req = new HTTP::Request 'GET',"$url";
# uncomment if you need it
# $req->quthorization_basic("user","pass");
my $res = $ua->request($req);
$res->is_success or die("didn't work $!");

my $page = $res->as_string;
$page =~ s/\&deg\;/

Report

quattro

16 years ago

I had to change:

$url = "www.weather.com/weather/local/" . $cityCode;

To:

$url = "www.w3.weather.com/weather/local/" . $cityCode;

Notice the addition of .w3

Report

angelrod

16 years ago

If I run the script from console, it gives me all the info for my city. But when I run it form superkaramba I only see the background. I already pressed like 20 times the "update" option and nothing.

My script climaEn.pl :

#!/usr/bin/perl
#usage: perl /usr/share/karamba-0.17/themes/karamba_weather/script/clima.pl www.weather.com/weather/local/BLXX0006
use LWP::UserAgent;
use HTML::TokeParser;

#City code according to http://www.weather.com, please check the small README
$cityCode = "MXGO0035";
$url = "www.w3.weather.com/outlook/travel/local/" . $cityCode ."?&setcookie=1";
#my $url = @ARGV[0];
my $ua = new LWP::UserAgent;

$url = "http://$url" unless($url =~ /^http:\/\//);

if($ENV{'http_proxy'}){
$ua->env_proxy;
$ua->proxy(http => $ENV{'http_proxy'});
}

my $req = new HTTP::Request 'GET',"$url";
# uncomment if you need it
# $req->quthorization_basic("user","pass");
my $res = $ua->request($req);
$res->is_success or die("didn't work $!");

my $page = $res->as_string;
$page =~ s/\&deg\;//g;
$page =~ s/\&nbsp\;/ /g;
$page =~ s/Feels Like/Feels Like /g;
my $p = HTML::TokeParser->new(\$page);

$initPositionIcon = index ($page, "http://image.weather.com/web/common/wxicons/52/");
$endPositionIcon = index ($page," ", $initPositionIcon);
$nameIconFile = substr($page, $initPositionIcon + 47, $endPositionIcon -47 - $initPositionIcon);

while ( $token = $p->get_tag("td") ) {
my $text = $p->get_trimmed_text("/td");
if ($token->[1]{class}=~/obsInfo1/i) {
$report = $report . "$text\n";
}
if ($token->[1]{class}=~/obsInfo2/i) {
$report = $report . "$text\n";
}
if ($token->[1]{class}=~/obsReported/i) {
$reportHeader = "$text\n";
}

}

$endPositionCity = index ($reportHeader, "Last");
$textCity = substr ($reportHeader, 15, $endPositionCity -15);
$textUpdateTime = substr ($reportHeader, $endPositionCity, -1);
print $textCity . "\n";
print "pics/" . $nameIconFile . "\n";
print $report;
print $textUpdateTime . "\n";



Any hints?

Report

Stratz979

15 years ago

I have the same problem too, if i run in console, i get the info, but when i run in superkaramba, i get the background image only, it appears that the text is displayed for a fraction of a second, but then it disappears (this might just be the window loading, hard to tell) i've also had no luck with any of the news programs as well, the only karamba app that works is ubermon, any ideas? is it something with my videocard? perhaps how i have set up my fonts? (using a basic suse 9.1 install)

Report

angelrod

16 years ago

If I run the script from console, it gives me all the info for my city. But when I run it form superkaramba I only see the background. I already pressed like 20 times the "update" option and nothing.

Any hints?

Report

omega527

16 years ago

It works great for 2 days. But now i get:tom@gryffindor:~/.kde/share/karamba/weather> perl script/climaEn.pl www.weather.com/weather/local/GMXX0051pics/3 May 2003 18:40:42 GMTPragma: no-cacheServer: ApacheVary: Accept-EncodingContent-Type: text/html; charset=iso-8859-1Client-Date: Fri, 23 May 2003 18:40:43 GMTClient-Peer: 63.111.66.11:80Client-Response-Num: 1Client-Transfer-Encoding: chunkedRefresh: 0;URL=/weather/local/GMXX0051?&setcookie=1What goes wrong?

Report

robint99

16 years ago

After a bit of fiddling I managed to come up with a solution for this. Change line 8 of the script to

$url = "www.weather.com/outlook/travel/local/" . $cityCode ."?&setcookie=1";

Works for me, anyway.

Report

aplock

16 years ago

perl script/climaEn.pl www.weather.com/weather/local/BLXX0006
----
Can't locate object method "new" via package "URI" at /usr/local/lib/perl5/site_perl/5.8.0/HTTP/Request.pm line 121.

help help
help

Report

RaZoR14

16 years ago

in script/climaEn.pl right after line 40 add the following code to see the degrees in celcius ;-):

if ($text =~ /

Report

maciunio

16 years ago

Works fine :)
Thnx.

Report

rrichie

16 years ago

for those who don't manage to get it work ( to have Celcius Degrees ):

add this code :
$text =~ s!(\d+)!sprintf "%.0f", 100/(212-32) * ($1 - 32 )!e;
$text =~ s/

Report

ex-gnome

16 years ago

Would you able to send (email) your code perl script to me? My attempt at changing my script to display celcius was uneventful. Thanks for the help.

Report

iT3rr0r

16 years ago

ok, when i run karamba and load ur theme, i get the png, like the other dude was sayin, but when i run that perl thing or whatever you said i get this:
it3rr0r@betsey2:~/karamba_weather$ $perl script/climaEn.pl www.weather.com/weather/local/BLXX000 6
Can't locate LWP/UserAgent.pm in @INC (@INC contains: /usr/lib/perl5/5.8.0/i386-linux /usr/lib/p erl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux /usr/lib/perl5/site_perl/5.8.0 /usr/lib/per l5/site_perl .) at script/climaEn.pl line 3.
BEGIN failed--compilation aborted at script/climaEn.pl line 3.


im running slackware 9 BTW

Report

12345678910
product-maker Count: 4 Rating: 5.0
File (click to download) MD5SUM Version Description Downloads Date Filesize DL OCS-Install
*Needs ocs-url or ocs-store to install things
Pling
Details
license
version
updated Aug 11 2004
added Apr 29 2003
downloads 24h
0
page views 24h 7