Page 101 of 122 FirstFirst ... 519199100101102103111 ... LastLast
Results 1,001 to 1,010 of 1219

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

  1. #1001
    Join Date
    Jul 2011
    Beans
    16

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

    Quote Originally Posted by 42dorian View Post
    First of all, there is a HowTo for VinDSL's Conky. Check my Sig, I wrote it myself.

    Second, all you need is the URL for a page that has your weather on it. If you have a web page that has your weather, even if it's not Accuweather, Weather Underground, or Weather.com, you just need that URL. Find a page that has your particular weather displayed, and copy the URL here. The magic will happen when someone sees your URL and turns it into a script.

    Once it's a script, it generates output files. In Conky, even VinDSL's Conky, you just need to insert a variable that looks at the output files and prints their results where the weather section is.

    READ THE VINDSL HOWTO! It'll get you going.
    Quote Originally Posted by TeoBigusGeekus View Post
    If you download the scripts, you'll find a file called Script-1d_How_It_Was_Created.pdf.
    Althought it refers to the old version of the 1d script, I think you could find some valuable clues there.
    Hi !

    @ Dorian : I have check your step-by-step nicely written tutorial on VinDSL's script when I built my conky. I think it's working quiet well now as you can see on the attached image.
    The url from which I'd like to grab informations is this one : http://www.meteosuisse.admin.ch/web/...z=1200&x=0&y=0
    I do like the "magic", but I prefer when I can understand what's doing in the black box. And I would like to know how to do it by myself in the future, that's why I was asking for a tutorial on "how to grab information from a website and pass them to conky".
    Anyway. If a script comes out of "the magic", may it be with some comments on the code .
    And finally, thanks for your literary description on how it works.


    @ TBG : Nice. Thank you for this clue, I will have a closer look to the file .

    Cheers.
    Attached Images Attached Images

  2. #1002
    Join Date
    Apr 2007
    Beans
    195

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

    Quote Originally Posted by Swiss_Knight View Post
    Hi !

    @ Dorian : I have check your step-by-step nicely written tutorial on VinDSL's script when I built my conky. I think it's working quiet well now as you can see on the attached image.
    The url from which I'd like to grab informations is this one : http://www.meteosuisse.admin.ch/web/...z=1200&x=0&y=0
    I do like the "magic", but I prefer when I can understand what's doing in the black box. And I would like to know how to do it by myself in the future, that's why I was asking for a tutorial on "how to grab information from a website and pass them to conky".
    Anyway. If a script comes out of "the magic", may it be with some comments on the code .
    And finally, thanks for your literary description on how it works.


    @ TBG : Nice. Thank you for this clue, I will have a closer look to the file .

    Cheers.
    Oh, I know you wanted to know how it's done. But, how YOURS gets done will start with someone making one for you, and you de-constructing it.

    I could tell you, in general, it's all about using the CURL command in a bash file, saving the raw page to a file, then running a bunch of SED commands that reduce the raw file down to something readable in output files. If you want weather fonts or images, some decision structures get put in that look for any instance of a weather condition, and interpret the phrase to a number or a letter in, yet another, output file.

    These custom weather scripts basically take raw data down from a web page with your weather conditions on it, and then translate what is there to output files that are laid out with specific data in specific places in the file. If your weather forecast includes days of the week, wind direction, temperatures, and weather conditions in text, then your output file's first entry will be the Day of the Week or Today/Now, Then the second will be wind direction, then the third will be temperatures, and the fourth the weather condition text. It will probably repeat that for the upcoming evening/night values of the same thing, so that brings you to 8 entries.

    Then it repeats for the number of days forecast listed on the page. So, when in Conky, you position a command to use sed -n '(A Number)p' on the output file with the weather messages in it, in the place you want an element, say the Day of the Week, or whatever element of the weather you're positioning. So, items 1-8 will be today, 9-16 would be tomorrow, 17-24, the next day, etc. all formatted the same as the first day.

    In this example, the text file would look a little like this:

    Code:
    Today
    NNW
    12
    Snow
    Tonight
    N
    4
    Clear
    And it would repeat again for the next day, and again until you run out of days that have been forecast. How many lines per day get used, as well as what is IN those lines, is dictated by what data can be gathered from the web page you provide, and will change accordingly. You can easily read the output file to find out for certain what they are and how many to use, where.

    In the case of using Weather/Wind Direction/Moon Fonts, separate files get generated from the first script. They look at, if your web page supplies it, anything that indicates wind direction/moon phase/weather condition, and decides a letter that that message represents. The letter corresponds to a letter in a font. In that font, instead of letters, they're pictures of weather conditions/moon phases/wind direction. In Conky, just as before, you use a sed -n '(a number)p' on the separate font file you are using, corresponding with the position in the file you want shown. But, here's the difference. In Conky, when using those fonts, you change the font with a font object. From the font you were using for the text to the ConkyWeather font, MoonPhase font, or ConkyWindNESW Font, depending on what you're displaying. Then you change it back to the font you were using before when you want the text to go back.

    This is all very general, and I'd love to create a full-blown HowTo for TBG's scripts, but I honestly don't get the editing he does. He's... He's amazing at it and I just am not good enough to understand that part. The aftermath? The results he gets? I understand those. I don't know how he goes about getting them, no matter how I try. So, this generalisation is the best guess I have.

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

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

    That's exactly how it's done - it's all in the pdf.
    With a little patience, you can parse any page you want, as long as it's consistent, ie. the info it provides has an expected structure.

  4. #1004
    Join Date
    Aug 2011
    Beans
    2

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

    Hello All...

    I've mixed up the script from the french forum (http://forum.ubuntu-fr.org) by Didier-T with the script of Teo (the french script)
    I can now have the wind icon and the messages cut properly to display on 2 lines the long messages.

    you'll find it in the zip file with the wind icons


    Teo, if you like the ideas in it can you keep them for futur updates...

    ...all the credits to Didier-T and the french team for the new code inserted...I just did the mix..

    have a nice conky...
    Attached Files Attached Files

  5. #1005
    Join Date
    Jul 2011
    Beans
    16

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

    Okay guys,
    I've learn how to grab informations from my website.
    It was something between , and.
    Never used the 'sed' command before, nor knew what it was.
    I had the problem that all the pertinent informations were on a single line !
    And it was not funny to see that sed was removing all text before, for example, the LAST "weathersymbols" string, when this string appears several times on the same line (and of course I needed all of them) !
    It's dirty, but I added some '\n' at some places to avoid that.

    Anyway.

    I read through the *.pdf of TBG to help myself in this quest. It's well done.
    And I finally ended up with a file with formatted informations I want conky to display.
    It looks like that (see attachment).
    First line = location
    Next lines = 5 next days, with their date
    singles numbers = c image number correspondence in my images folder
    text = describing conditions, corresponding to the image number just before each line of text
    After that, all sections contains the different conditions for the next 5 days (T°C <- 2 lines a day with Tmin & Tmax, Sunshine, etc.)

    And the question is ; what should I do from there ?
    Attached Files Attached Files
    Last edited by Swiss_Knight; January 27th, 2012 at 01:25 AM.

  6. #1006
    Join Date
    Apr 2007
    Beans
    195

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

    Quote Originally Posted by Swiss_Knight View Post
    Okay guys,
    I've learn how to grab informations from my website.
    It was something between , and.
    Never used the 'sed' command before, nor knew what it was.
    I had the problem that all the pertinent informations were on a single line !
    And it was not funny to see that sed was removing all text before, for example, the LAST "weathersymbols" string, when this string appears several times on the same line (and of course I needed all of them) !
    It's dirty, but I added some '\n' at some places to avoid that.

    Anyway.

    I read through the *.pdf of TBG to help myself in this quest. It's well done.
    And I finally ended up with a file with formatted informations I want conky to display.
    It looks like that (see attachment).
    First line = location
    Next lines = 5 next days, with their date
    singles numbers = c image number correspondence in my images folder
    text = describing conditions, corresponding to the image number just before each line of text
    After that, all sections contains the different conditions for the next 5 days (T°C <- 2 lines a day with Tmin & Tmax, Sunshine, etc.)

    And the question is ; what should I do from there ?
    You go to your .conkyrc and put the data in where you feel you want them. You said you copied VinDSL's Conky, well, you replace the weather section with what you've found with your script. Each line is an "Object" of sorts. Each line corresponds with something you want to place in Conky, on it's own. The number of that line will go in this general object in Conky:

    Code:
    ${exceci 600 sed -n '(the number)p' /path/to/output/file}
    That's it. You just need to put as many of those objects as you want to use into Conky, and use the ${offset}, ${voffset}, and ${goto} commands to place them in the positions you want them in. Of course, format colours, fonts, and whatever else you want around the objects you want to format. Play around with positions and the like until you're happy with how it looks. We can't tell you what looks good to you, you're just going to have to keep going until the guy in the mirror says "Good Job!", 'cause that'll be the guy who is most critical of you.

    Importantly though, you're going to want to run the script you wrote every time Conky runs. So, make the script executable, give all user rights the ability to execute it, and put this object above the weather section, before you start formatting anything:

    Code:
    ${texeci 1800 bash /path/to/your/script}
    Have fun.

  7. #1007
    Join Date
    Feb 2008
    Beans
    5,636

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

    Quote Originally Posted by shamen456 View Post
    Hello All...

    I've mixed up the script from the french forum (http://forum.ubuntu-fr.org) by Didier-T with the script of Teo (the french script)
    I can now have the wind icon and the messages cut properly to display on 2 lines the long messages.

    you'll find it in the zip file with the wind icons


    Teo, if you like the ideas in it can you keep them for futur updates...

    ...all the credits to Didier-T and the french team for the new code inserted...I just did the mix..

    have a nice conky...
    Thanks a lot for posting it here; it's indeed a very good job.
    I've added a link in the first page.

  8. #1008
    Join Date
    Jul 2011
    Beans
    16

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

    Hi again,

    I think I got this Dorian

    But... I encountered some issues, like this one ; conky stops with this as last line in the console :
    Code:
    Conky: too many special things in text
    So, I am not able to change the colour of the two different temperatures per day. It seems it can not manage so much fancy things uh...
    I find this strange.

    2nd thing :

    By adding colours that are not used with the colorN command, with the HEX code like
    ${colour #ff0033}bla bla text${color}
    , I use the sharp sign (#) which is also the marker to comment a line ! So all my line after the first sharp sign used in the colour command becomes blue in my text editor. Is the rest of the line still interpreted by Conky ?
    This 'issue' may overlap the idea in the problem described just below...

    3nd thing :

    Do you ever see some really weird things on your display ? at the bottom ?
    Sometime I can see there some "pieces of code" or fancy symbols
    It appears that when I delete some "blocks" of commented text in my .conkyrc, it goes right again.
    So, I might think that Conky is interpreting even the commented lines ! Should it be reported somewhere ?? Have any of you ever had this problem ?

    4th thing :

    I do want to put an radar image of precipitation.
    And I want this to be more frequently updated than my weather icons, which can be updated maybe once each 3 hours. But the radar picture should be updated something like every 15 minutes.
    So, I am not sure I did it the right way but I made an other small script called radarimg and making it executable. It basically contains :
    Code:
    rm ~/conkymeteo/images/radar.png
    address_img="http://www.meteosuisse.ch/teasers/fr/meteo/Radar.Related.0006.Image.gif"
    wget -r -N $address_img -O ~/conkymeteo/images/radar.png
    When I launch this script in a console, all is OK, the image is downloaded where I want.
    But. If I call this image by using this line in my .conkyrc :
    Code:
    ${goto 5}${voffset 42}${image ~/conkymeteo/images/radar.png -p 135,720 -s 121x80}
    yes you obviously noticed that it's a gif in the URL bar, and I saved it as a png. It's because it wouldn't open as a gif and GIMP said me it is in png format. Strange but it works.

    I have this message :
    Code:
    Conky: Unable to load image '/home/swissknight/conkymeteo/images/radar.png'
    which repeatedly comes in the console (once every 1.5 sec).
    Even if I put this before my weather section
    ${texeci 1800 bash ~/conkymeteo/radarimg}
    Just one more question at this point ; should I put this texeci command within my TEXT area, just before where I will use all the excecpi commands that are calling for my output file ? Or should I put it before the TEXT, at the top where all general variables ares in my .conkyrc file ?
    Does this command basically execute my bash file that is downloading and parsing the webpage ? And, is the parameter 1800 the time in seconds it executes this script ? So for example here, is it every 30 minutes that I make request to the website and download the informations, overwriting my old output file ?

    That's it for now Thanks a lot.

    I just have one suggestion for TBG : I've searched for a while before knowing what to do from the step "I have my output file that contains the informations to be displayed" and the step "tell Conky to gather and display them".
    I have found a post from you in the middle of this thread (do not remember the page) where you put part of your .conkyrc where such code was available.
    I had to see that it was code that was looking into your output file and then try to see that it was "the right way to do it".

    So, could you, for beginners like me, add such kind of information on the first page please ? Basically, describing what to add as a command in .conkyrc to pick a precise information (line number) and making it understandable for conky. With a small example.

    Thanks a lot !

    Cheers
    Last edited by Swiss_Knight; January 27th, 2012 at 03:37 PM.

  9. #1009
    Join Date
    Apr 2007
    Beans
    195

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

    I can help with 1 and 2. The other two are... Well... go to the big Conky Thread to ask them. More people are experienced with using that stuff than I am. I'm in an area that doesn't have a RADAR output, so I don't use it. I know not how it is done, I'm afraid.

    1. Add this in your environment variables section (Above the TEXT area.)

    Code:
    max_specials 2048
    That will end the "Special Things" problem. The Default, when not mentioned, is 512. There's a whole lot of special calls (texeci/execi/etc.) in most Conky setups these days.

    Now that I think of it, mentioning the texeci thing. Add it just above the weather. In the TEXT area. Keep it close. It doesn't output anything, it just runs the script fresh when Conky starts or refreshes. The 1800 is, indeed, the time in seconds when it will next execute the script. Every execi and texeci command has a timer. That's what the i is. INTERVAL. The t on the texeci means THREADED. As in, it runs this as a background process, separate from Conky itself. The other calls using sed will be the output, so don't be concerned with anything other than their positioning and formatting.

    2. Take the hash/number sign out of your colours in the color object. (Yes. I know I spelled Colour with a U, and then called it a COLOR object. I'm Canadian, I spell Colour with a U. Conky, on the other hand, is American, for all intents and purposes, and they named their object a COLOR Object. So, it's a proper name, and the syntax you should use.)

    Conky doesn't need the hash sign in the colours. That solves the problem outright.

    If you have general questions about Conky itself, ask in the big Conky Thread. Not that you're not welcome to ask them here, just, there's much more data there, and you will increase the likelihood of getting the answer you need if you cast a wider net, as the metaphor goes.
    Last edited by 42dorian; January 27th, 2012 at 06:26 PM.

  10. #1010
    Join Date
    Feb 2008
    Beans
    5,636

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

    After creating an english, french and spanish 1d1 script, dancer_69 reminded me I'm Greek.
    Here's the Greek version of the script.
    If any Greek friend could give me some feedback about it, I'd be obliged.

    EDIT: Script included with the rest in the large dropbox tarball - see first page.
    Attached Images Attached Images
    Last edited by TeoBigusGeekus; January 29th, 2012 at 05:02 PM.

Page 101 of 122 FirstFirst ... 519199100101102103111 ... 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
  •