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.)
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
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...
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
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?
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/\°\;/
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
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?
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/\°\;//g;
$page =~ s/\ \;/ /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?
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)
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?
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.
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
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/
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
Ratings & Comments
55 Comments
dead. stillborn. never worked. why is this here?
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.)
Is there any solution in the meantime? I too only have the backgroundpanel...
Still nothing but background. Carefully edited as per ALL of your instructions. Using Mandrake10.OE. Have tried 8 times without success. John
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
Same here, no icons, just the background.
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...
I get only the background image, no text, no icons, nothing. Any suggestions ?
I added w3 to url to make the perl errors go away so it displays the weather, but there are no icons.
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
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?
Try deleting the corresponding karamba *.rc file?
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/\°\;/
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
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?
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/\°\;//g; $page =~ s/\ \;/ /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?
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)
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?
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.
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
in script/climaEn.pl right after line 40 add the following code to see the degrees in celcius ;-): if ($text =~ /
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.
Works fine :) Thnx.
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/
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