|
OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD. |
|
Thread Tools | Display Modes |
|
|||
GKrellM weather plugin woes
http://openports.se/sysutils/gkrellm/plugins/weather
I'm having a little trouble getting this to work right. Out of the box the plugin doesn't give the weather. So I found this link that says to update a weblink in the script '/usr/local/bin/gkrellm.GrabWeather' https://groups.google.com/forum/#!to...st/zilMiI9WHRI But when I make the change and run gkrellm it says: Quote:
Code:
die "unable to fetch weather: $?" if `$cmd` == 0; Code:
# Is LWP installed? eval { require LWP::UserAgent }; if ($@) { my $cmd = qq{ftp -o $home/$ReportDir/$HTMLFileName $URL}; die "unable to fetch weather: $?" if `$cmd` == 0; } else { $ENV{FTP_PASSIVE} = 1; # LWP uses Net::FTP internally. my $ua = new LWP::UserAgent; my $req = new HTTP::Request( GET => $URL ); my $rsp = $ua->request( $req ); die $rsp->status_line unless $rsp->is_success; my $fh = new IO::File "> $home/$ReportDir/$HTMLFileName" or die "unable to write '$home/$ReportDir/$HTMLFileName': $!"; print $fh $rsp->content; close $fh or die "error closing '$home/$ReportDir/$HTMLFileName': $!"; } It is definately getting the data from the website. When I hover the mouse over it a text file with all the weather data appears, however the interface just shows. +0C -99%. It is a great program otherwise. |
|
|||
I have 3 small scripts that retrieve and display current conditions, forecast and animated weather radar. The scripts utilize no cpu cycles or bandwidth until run. I had to adjust my scripts when sites were migrated in the US and I'm also aware that the gnome/xfce4 weather applets had to be redone for the same reasons. I'd be glad to post the scripts if there is interest.
Edit: I looked at your link and my scripts had the same issue. These currently work Current METAR: Code:
#!/bin/ksh xterm -g 70x15-1+39 -T "Yakima, WA Weather" -hold -e \ curl -sk http://tgftp.nws.noaa.gov/data/observations/metar/decoded/KYKM.TXT https://en.wikipedia.org/wiki/List_o...tion_indicator Forecast: Code:
#!/bin/ksh xterm -g 125x46-1+38 -T "Yakima, WA Weather" -hold -e "curl http://wttr.in/~Yakima+WA" Radar: Code:
#!/bin/ksh # This is a simple script that downloads a radar image from # Wunderground weather and plays back with ImageMagick # The script is configured for US Pacific NW composite radar # To change the site edit the https site # Browse https://www.wunderground.com/maps/catalog/ for *.gifs (animated) curl https://icons.wxug.com/data/weather-maps/radar/united-states/redmond-oregon-region-current-radar-animation.gif | \ animate -immutable -loop 0 -title "NorthWest Radar Loop" Last edited by shep; 13th November 2018 at 04:13 PM. Reason: Somehow my paste produced a double entry ?press/release |
|
|||
Thanks for those shep. Great scripts.
Last edited by Prevet; 13th November 2018 at 12:59 AM. |
|
|||
I have some diversity in my 3 computers all of which dual-boot: Debian 9+OpenBSD stable, Fedora 29+OpenBSDcurrent/SimpleDE and Arch Linux+OpenBSDcurrent porting efforts.
I recall that Debian disabled ImageMagick's ability to fetch web content as a security issue. Adding curl made the scripts usable on all my systems. I use BSD tools in Debian and Fedora and will trial your ftp suggestion. Will OpenBSD's ftp retrieve from https? Last edited by shep; 13th November 2018 at 05:41 PM. |
|
||||
Shep, using ftp works for me on all of the three scripts you posted, including https connections.
By the way, the curl user agent is only necessary for wttr.in. I think that site does a check for the user agent and delivers different output otherwise. At least that was the case when I played with it a couple of months ago. Oh, and thanks for the METAR one! I tested it with the three nearest airports in my area and it even receives data supplied by the big NATO airbase not too far from my town. Very cool. |
|
|||
If you are in the US, you can get individual radar station gifs directly from weather.gov.
Code:
https://radar.weather.gov/ridge/lite/NCR/PDT_loop.gif Code:
http://tgftp.nws.noaa.gov/data/forecasts/zone/wa/waz027.txt |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
USB modem woes | Paianni | OpenBSD General | 2 | 25th August 2018 05:54 PM |
Xorg woes... | jb_daefo | FreeBSD General | 1 | 5th June 2011 04:35 AM |
torsmo displaying weather question | neurosis | FreeBSD General | 6 | 20th October 2008 10:53 PM |
widescreen woes | jbhappy | FreeBSD General | 8 | 25th June 2008 08:25 PM |
gkrellm launches slowly | hydra | FreeBSD Ports and Packages | 1 | 16th May 2008 07:00 PM |