Conky weather+moon scripts (Accuw/WUndergr/NWS/Weather.com/Lunaf.com)

ABSTRACT

Some scripts for displaying a weather forecast or the moon phases on your conky.They use Accuweather, Weather Underground, National Weather Service (USA), Weather.com and lunaf.com.They all rely on the same principle: download a bunch of pages, parse them and isolate the necessary info for conky to find.There is something for everyone: from the minimalistic (1d), to the humongous, larger than life, "I'm a meteorologist" aspect (4).

POINTS TO NOTICE

If you hate my scripts, throw me some hate mail and visit Mr.Peachy's thread. That guy certainly knows his LUA...

All the scripts (I think, check it out yourselves) use the commandkillall wgetat the beginning of the script. The command, which kills all instances of wget, is a reminiscent of an older version of the scripts that used curl instead of wget.Curl had the annoying habit of leaving unfinished, zombie processes after its every call; therefore I added a "killall curl" at the beginning of every script.Later, I changed curl with wget, so the command became "killall wget"; not that wget behaves like curl, in terms of zombie processes, but better save than sorry...If you use wget for downloading, these scripts are gonna kill it; you can either remove the command from the scripts or use curl instead.

12-12-14: Weather.com have completely changed their web pages - they are now protected by javascript, so wget and curl are of no use anymore. The weather.com's scripts have been completely rewritten using phantomjs, a tool that, although slow, solves the problem of downloading a javascript "infested" page. There's now a 4a (Today/Tonight and some days' forecast) script and a 4b (Current conditions' -mainly- forecast) script.

23-3-14: Script 2b updated. It now supports different icons for the moon depending on whether you live in the northern or southern hemisphere as explained in S11's posts here and here.

19-3-14:Script 5 updated. It now supports different icons for the moon depending on whether you live in the northern or southern hemisphere. Awesome catch by S11 as explained in his posts here and here.

15-2-14:2b minor bugs corrected. Thanks to S11 - see this for more info.

12-2-14:New script added: 2b_Wunderground_API. This one uses Weather Underground's API feature and can be used by all users. Treat with tenderness and affection. Also, I now have a tarball for every script and not a large one containing all of them. It will save you bandwidth in case of updates...

30-1-14:Facelift of the 3_NWS script - new, better conkyrc, some additions in the script itself, etc. Thanks to KrunchTime for his valuable feedback. I hadn't touched this one since 2009-2010 but it still works: if you don't mind its rather Spartan look, you're in the US and you like stability, that's the script to go. By the way, I also tried the 2_WUnderground ICAL script and it still works as well (untouched for some years too). Me thinks that I spend all the time with the crappy Accuweather and Weather sites and I miss the real gems...

21-1-14:Another bug discovered in the 5_Moon script - if the moon is in libra the output gets screwed up. Script rebundled. Once more, thanks to Fortran for his feedback.

Sector11 has put together a hybrid conkyrc, joining the weather.com and the moon ones. He's also put together a script that does the job of 4 and 5 together. Check it out here.

A full proposal, again by S11, combining this script and 2b (Wunderground API), as well as a weather clock-chronograph.Check it out.

Last edited by TeoBigusGeekus (2015-01-29 12:28:13)

Please make Autocad Civil 3D and Archicad work on Linux!Please make Autocad Civil 3D and Archicad work on Linux!Please make Autocad Civil 3D and Archicad work on Linux!Please make Autocad Civil 3D and Archicad work on Linux!

Glad to see you here at CrunchBang, your journey has been a long and fortuitous one!

Thank you very much for the warm welcome VastOne; as I said in the other thread, I hope that this is the beginning of a beautiful friendship!

Please make Autocad Civil 3D and Archicad work on Linux!Please make Autocad Civil 3D and Archicad work on Linux!Please make Autocad Civil 3D and Archicad work on Linux!Please make Autocad Civil 3D and Archicad work on Linux!

Have you had a look at parsing the hourly forecast page? I'm a cyclocommuter, and I rely on the hourly forecasts to know whether I'll need my weatherproof gear for my commute. (Though this time of year weather.com's forecasts become particularly unreliable in my area.)

@pvsageDo you mean an hourly forecast for all days, or just today?Would accuweather's one interest you?

Last edited by TeoBigusGeekus (2012-04-28 18:57:01)

Please make Autocad Civil 3D and Archicad work on Linux!Please make Autocad Civil 3D and Archicad work on Linux!Please make Autocad Civil 3D and Archicad work on Linux!Please make Autocad Civil 3D and Archicad work on Linux!

I've been supporting Teo's scripts for a while. Took all my posts over to the "Blue" side from the "Orange" side and now I'll be posting them here on "The DarkSide" - and we has cookies too!

Posts are copy/pasted from the Orange side since "Dust Bin" on the Blue side means "take out the trash" only this time they tossed out something extremely valuable to the conky community and Linux in general.

OK, enough of my rambling, lets get on with it....

Been a while, I'm slowly getting back into things. Here's a modified version of the default

1d1) Accuweather - Images - INTERNATIONAL USERS

It's more compact, fits smaller screens - but I like it on my screen regardless. Text for "conditions" other than right now have been removed and the "images" have been resized "180x180" making them easier to change the size in the conky itself.

NOTE:Using blank lines and [spacebar] for spaces where ever I can as it's been noted that an over use of ${voffset}, ${offset} and ${goto} commands chew up CPU resources. These are small conkys designed for the small screens on netbooks and notebooks that may have lower amounts of memory.

The New one: The conky is the same height and only 5 pixels wider - mainly because if the Moonrise and Moonset times needed more space.

My directory structure looks like this:

~/AccuW_2/accuw.conky

~/AccuW_2/BsAs

~/AccuW_2/BsAs/acc_int_images

~/AccuW_2/BsAs/Forecast_Images

~/AccuW_2/London

~/AccuW_2/London/acc_int_images

~/AccuW_2/London/Forecast_Images

Each of the 'acc_int_images' scripts have been modified to use the directory they are in and each section of the conky looks for the weather information in the directory concerned. I suppose I could have had the scripts read from a central image directory and write to the city directory, but I was in a hurry and this seemed faster. Besides, I didn't want to run the risk of trying to copy 1 image to two (or maybe more in the future) locations at the same time.

This part NO LONGER APPLIES - everything else is the same:

This conky uses the 180x180 images found in: AccuW.tar.gz, seen here. I should convert them to the regular images.

A Project for Tomorrow! - Done! The conky now uses the images out of the box, I have finally wrapped my teeth around a proper re-sizing method for the conky images command.

Dumbledor 1 Cut Up is used for "Now temp" and "FL temp" if FL is equal to or higher than the "Now temp" and if higher it will also turn red.Dumbledor 1 Cut Down is used for FL temp when it is cooler than the Now Temp and it will be blue.

Other than that everything is out of the box with some 'slight' changes in the directory structure and calling of the same.

Accuweather does look interesting, though I've never considered it for an hourly forecast. I probably should look at it and see if it trends any better than weather.com.

Since the hourly forecast is something I look at for a daily commute, just the current forecast (e.g. the 12 hours on the weather.com/weather/hourbyhour/{zipcode} page) would be splendid.

EDIT: I see accuweather puts its chance of rain forecast on a separate page...this is the part I'm most interested in.

Since this is going to be a personalized script, could you give me your location's details?

Please make Autocad Civil 3D and Archicad work on Linux!Please make Autocad Civil 3D and Archicad work on Linux!Please make Autocad Civil 3D and Archicad work on Linux!Please make Autocad Civil 3D and Archicad work on Linux!

Unfortunately, beyond these 12 hours of precipitation forecast, Accuweather asks for a subscription.I hope that this comes close to what you want.

Last edited by TeoBigusGeekus (2012-05-17 16:35:06)

Please make Autocad Civil 3D and Archicad work on Linux!Please make Autocad Civil 3D and Archicad work on Linux!Please make Autocad Civil 3D and Archicad work on Linux!Please make Autocad Civil 3D and Archicad work on Linux!