Page 37 of 122 FirstFirst ... 2735363738394787 ... LastLast
Results 361 to 370 of 1219

Thread: Conky weather scripts using Accuweather/WUnderground/NWS/Weather.com

  1. #361
    Join Date
    Feb 2010
    Beans
    Hidden!

    Re: HOW TO: Conky weather info using Accuweather/WUnderground/NWS

    Quote Originally Posted by roc4fun View Post
    Hi Teo, I like the weather icons (images) used by Conkyforcast. There is a section in Kaivalagi's python script that translates the verbal conditions into a number which corresponds to an image.
    Code:
      # translatable dictionaries
        conditions_text = {
            "0": _(u"Tornado"),
            "1": _(u"Tropical Storm"),
            "2": _(u"Hurricane"),
            "3": _(u"Severe Thunderstorms"),
            "4": _(u"Thunderstorms"),
            "5": _(u"Mixed Rain and Snow"),
            "6": _(u"Mixed Rain and Sleet"),
            "7": _(u"Mixed Precipitation"),
            "8": _(u"Freezing Drizzle"),
            "9": _(u"Drizzle"),
            "10": _(u"Freezing Rain"),
            "11": _(u"Light Rain"),
            "12": _(u"Rain"),
            "13": _(u"Snow Flurries"),
            "14": _(u"Light Snow Showers"),
            "15": _(u"Drifting Snow"),
            "16": _(u"Snow"),
            "17": _(u"Hail"),
            "18": _(u"Sleet"),
            "19": _(u"Dust"),
            "20": _(u"Fog"),
            "21": _(u"Haze"),
            "22": _(u"Smoke"),
            "23": _(u"Blustery"),
            "24": _(u"Windy"),
            "25": _(u"N/A"),
            "26": _(u"Cloudy"),
            "27": _(u"Mostly Cloudy"),
            "28": _(u"Mostly Cloudy"),
            "29": _(u"Partly Cloudy"),
            "30": _(u"Partly Cloudy"),
            "31": _(u"Clear"),
            "32": _(u"Clear"),
            "33": _(u"Fair"),
            "34": _(u"Fair"),
            "35": _(u"Mixed Rain and Hail"),
            "36": _(u"Hot"),
            "37": _(u"Isolated Thunderstorms"),
            "38": _(u"Scattered Thunderstorms"),
            "39": _(u"Scattered Showers"),
            "40": _(u"Heavy Rain"),
            "41": _(u"Scattered Snow Showers"),
            "42": _(u"Heavy Snow"),
            "43": _(u"Heavy Snow"),
            "44": _(u"N/A"),
            "45": _(u"Scattered Showers"),
            "46": _(u"Snow Showers"),
            "47": _(u"Isolated Thunderstorms"),
            "na": _(u"N/A"),
            "-": _(u"N/A")
        }
    I think I can make the translation happen, but conky doesn't like this statement to call the image...

    Code:
    ${image [sed -n '2p' /home/dave/accuweather_conky_USA/images] -p 40,720 -s 64x64}
    Conky seems to choke on the sed statement.

    Dave
    Why didn't I think of that - nice idea!!!
    {cuz ya can't think of everything dummy!}
    BUT - the "text" doesn't match what accuweather uses to start with.

    To see what accuweather uses for images and maybe grab them (for USA use) {Internationl are different will explain lower down} got here:

    http://www.accuweather.com/us/ar/bla...asp?view=table
    I hit anchorage Alaska - to get snow - and Hawaii, believe it or not to get RAIN and LA for sun

    and scroll down....

    Sun is: su-h.png
    Mostly sunny: msu-h.png
    Partly sunny: psu-h.png
    Rain and drizzle possible: mc-h.png

    I've manages to collect a few ...


    For International users accuweather uses blue square images - YUK! and the naming structure is different. xx_int.jpg.

    At least the USA images are transparent images like conkyForecast.

    And Wunderground uses what looks like bargain basement 25¢ transparent cartoon style gifs.

    So converting or using what conkyForecast has is an idea I started with, I have some renamed to 1_int.png 2_int.png etc but haven't figured how to use them - YET!


    Brainstorming is good!

  2. #362
    Join Date
    Feb 2008
    Beans
    5,636

    Re: HOW TO: Conky weather info using Accuweather/WUnderground/NWS

    Quote Originally Posted by roc4fun View Post
    Code:
    ${image [--sed -n '6p' ~/accuweather_conky_USA/images] -p 180,290 -s 64x64}
    Try changing it to
    Code:
    ${image $(sed -n '6p' ~/accuweather_conky_USA/images) -p 180,290 -s 64x64}

  3. #363
    Join Date
    Feb 2008
    Beans
    5,636

    Re: HOW TO: Conky weather info using Accuweather/WUnderground/NWS

    When the accuweather rss center failed me, my first attempt was to use the accuweather web page along with images.
    I didn't like the outcome, so I switched to the classic conky forecast font.

    To collect all the images accuweather or wunderground use, all you have to do is look into the raw files that the scripts create.
    Opening for example the international accuweather raw file and doing a search for "icon", the address
    http://vortex.accuweather.com/adc200...lue/33_int.jpg
    comes up.
    Visiting this link, it is clear that it is a weather icon.
    So, accuweather stores its international images in this form. How many images could there be?
    Let's find out:
    Code:
    #!/bin/bash
    for (( i=0; i<=200; i++ ))
      do
       wget http://vortex.accuweather.com/adc2004/common/images/wxicons/87x79_blue/"$i"_int.jpg
      done
    Running this loop, I managed to collect up to 44_int.jpg. These are obviously all the weather icons used by accuweather's international forecast (see screenshot).
    You can collect the images used by accuweather USA in a similar manner.
    Attached Images Attached Images

  4. #364
    Join Date
    Feb 2010
    Beans
    Hidden!

    Re: HOW TO: Conky weather info using Accuweather/WUnderground/NWS

    Quote Originally Posted by TeoBigusGeekus View Post
    When the accuweather rss center failed me, my first attempt was to use the accuweather web page along with images.
    I didn't like the outcome, so I switched to the classic conky forecast font.

    To collect all the images accuweather or wunderground use, all you have to do is look into the raw files that the scripts create.
    Opening for example the international accuweather raw file and doing a search for "icon", the address
    http://vortex.accuweather.com/adc200...lue/33_int.jpg
    comes up.
    Visiting this link, it is clear that it is a weather icon.
    So, accuweather stores its international images in this form. How many images could there be?
    Let's find out:
    Code:
    #!/bin/bash
    for (( i=0; i<=200; i++ ))
      do
       wget http://vortex.accuweather.com/adc2004/common/images/wxicons/87x79_blue/"$i"_int.jpg
      done
    Running this loop, I managed to collect up to 44_int.jpg. These are obviously all the weather icons used by accuweather's international forecast (see screenshot).
    You can collect the images used by accuweather USA in a similar manner.
    Genius - pure GENIUS!!!!

  5. #365
    Join Date
    Feb 2010
    Beans
    Hidden!

    Re: HOW TO: Conky weather info using Accuweather/WUnderground/NWS

    Ran into a problem (not as smart as you) with Accuweather USA, it uses nice size transparent .png's that would work GREAT "as is" in a conky. problem is there are two directories
    and the images don't follow a pattern nor do they have counterparts of all in each directory:


    Sun - no /night version of "psus-h.png"
    http://vortex.accuweather.com/adc201...day/psus-h.png

    http://vortex.accuweather.com/adc201...ns-day/t-h.png

    http://vortex.accuweather.com/adc201...s-day/ic-h.png
    http://vortex.accuweather.com/adc201...night/ic-h.png

    http://vortex.accuweather.com/adc201...ns-day/r-h.png
    http://vortex.accuweather.com/adc201...-night/r-h.png

    SUN only
    http://vortex.accuweather.com/adc201...s-day/su-h.png

    variable clouds with shower
    http://vortex.accuweather.com/adc201...-day/mcs-h.png
    http://vortex.accuweather.com/adc201...ight/mcs-h.png

    I tried:
    Code:
    #!/bin/bash
    for (( *=0; *<=200; * ))
      do
    #   wget http://vortex.accuweather.com/adc2004/common/images/wxicons/87x79_blue/"$i"_int.jpg
       wget http://vortex.accuweather.com/adc2010/images/icons-night/"$1".png
      done
    and I swear I heard laughter coming out of my speakers.

  6. #366
    Join Date
    Feb 2008
    Beans
    5,636

    Re: HOW TO: Conky weather info using Accuweather/WUnderground/NWS

    What got into them?
    I guess nothing can be done then....
    Perhaps they do this deliberately, I don't know.

  7. #367
    Join Date
    Feb 2010
    Beans
    Hidden!

    Re: HOW TO: Conky weather info using Accuweather/WUnderground/NWS

    Quote Originally Posted by TeoBigusGeekus View Post
    What got into them?
    I guess nothing can be done then....
    Perhaps they do this deliberately, I don't know.
    Yea ... there has to be a way ... I have two friends I can ask

  8. #368
    Join Date
    Jan 2007
    Beans
    16

    Re: HOW TO: Conky weather info using Accuweather/WUnderground/NWS

    Quote Originally Posted by TeoBigusGeekus View Post
    Try changing it to
    Code:
    ${image $(sed -n '6p' ~/accuweather_conky_USA/images) -p 180,290 -s 64x64}
    Thanks Teo, It still says "unable to load '$(sed'

    Here is what is in my images folder...

    Code:
    su
    msu
    su
    msu
    r
    /home/dave/.weathericons/32.png
    /home/dave/.weathericons/34.png
    /home/dave/.weathericons/32.png
    /home/dave/.weathericons/34.png
    /home/dave/.weathericons/12.png
    The top lines are what comes from the raw file, the bottom are the translation into icons.

    I think my translation is working, I just can't call the image correctly.

    Dave

  9. #369
    Join Date
    Jan 2007
    Beans
    16

    Re: HOW TO: Conky weather info using Accuweather/WUnderground/NWS

    Sector 11,

    I'm translating from the accuweather script like this...

    Code:
    test_image () {
    	case $1 in
    	 c|d|f)
    	   echo /home/dave/.weathericons/28.png
    	 ;;
    	 fl|sn)
    	   echo /home/dave/.weathericons/16.png
    	 ;;
    	 cl)
    	   echo /home/dave/.weathericons/31.png
    	 ;;
    	 pc)
    	   echo /home/dave/.weathericons/29.png
    	 ;;
    	 co)
    	   echo /home/dave/.weathericons/28.png
    	 ;;
    	 fr|r)
    	   echo /home/dave/.weathericons/12.png
    	 ;;
    	 h|ic)
    	   echo /home/dave/.weathericons/34.png
    	 ;;
    	 ho)
    	   echo /home/dave/.weathericons/36.png
    	 ;;
    	 i)
    	   echo /home/dave/.weathericons/42.png
    	 ;;
    	 mcl)
    	   echo /home/dave/.weathericons/33.png
    	 ;;
    	 mc)
    	   echo /home/dave/.weathericons/30.png
    	 ;;
    	 mcfl|mcsn|psfl)
    	   echo /home/dave/.weathericons/41.png
    	 ;;
    	 mcs)
    	   echo /home/dave/.weathericons/39.png
    	 ;;
    	 pcs)
    	   echo /home/dave/.weathericons/45.png
    	 ;;
    	 mct|psut)
    	   echo /home/dave/.weathericons/37.png
    	 ;;
    
    	 pct)
    	   echo /home/dave/.weathericons/47.png
    	 ;;
    	 msu|psu)
    	   echo /home/dave/.weathericons/34.png
    	 ;;
    	 psus)
    	   echo /home/dave/.weathericons/39.png
    	 ;;
    	 s)
    	   echo /home/dave/.weathericons/11.png
    	 ;;
    	 rsn|sl)
    	   echo /home/dave/.weathericons/06.png
    	 ;;
    	 su)
    	   echo /home/dave/.weathericons/32.png
    	 ;;
    	 t)
    	   echo /home/dave/.weathericons/04.png
    	 ;;
    	 w)
    	   echo /home/dave/.weathericons/23.png
    	 ;;
    	esac
    }
    This is the top part of the accuweather script.

    Dave

  10. #370
    Join Date
    Apr 2007
    Beans
    195

    Re: HOW TO: Conky weather info using Accuweather/WUnderground/NWS

    Quote Originally Posted by roc4fun View Post
    Thanks Teo, It still says "unable to load '$(sed'

    Here is what is in my images folder...

    Code:
    su
    msu
    su
    msu
    r
    /home/dave/.weathericons/32.png
    /home/dave/.weathericons/34.png
    /home/dave/.weathericons/32.png
    /home/dave/.weathericons/34.png
    /home/dave/.weathericons/12.png
    The top lines are what comes from the raw file, the bottom are the translation into icons.

    I think my translation is working, I just can't call the image correctly.

    Dave
    Not sure if the image object can do this, but you may want to run an execi command inside it.

    Code:
    ${image ${execi 600 -n '6p' ~/accuweather_conky_USA/images} -p 180,290 -s 64x64}
    It may well be that we need to find a completely different way to do it.

    *EDIT* This is just a stab in the dark... but what about a second script, unattached to the main one. It sets up an empty icon for each of the forecasted days and nights, then reads in the results of the icon file, and copies the appropriate weather condition image to that day. That way, you can program the images to always be the same:

    Code:
    ${image ~/path/to/Conky/Weather/Script/Icons/forecasticond1.png -p 180,290 -s 64x64}
    ${image ~/path/to/Conky/Weather/Script/Icons/forecasticond2.png -p 180,290 -s 64x64}
    ${image ~/path/to/Conky/Weather/Script/Icons/forecasticond3.png -p 180,290 -s 64x64}
    ...
    That way, the image object in Conky doesn't have to do anything, a script would simply store the appropriate weather icon to the correct forecasted day, and Conky would simply refresh the image when it refreshes itself.
    Last edited by 42dorian; October 29th, 2011 at 11:35 PM.

Page 37 of 122 FirstFirst ... 2735363738394787 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •