Results 1 to 4 of 4

Thread: Conky and Rss Feed

  1. #1
    Join Date
    Feb 2013
    Beans
    24

    Conky and Rss Feed

    Hi all.
    I hope I'm posting this in the right place.

    I am in the process of writing my new conky script, and I am wanting to put a "word of the day" script in.
    So I decided I could just use conky's built in rss function for this
    so
    Code:
    ${color}${rss http://www.wordthink.com/feed 720 item_titles 1}
    And this works great for the title, however when i use it for the descrtipton (ie definition)
    Code:
    ${color}${rss http://www.wordthink.com/feed 720 item_desc 1}
    I end up with 2 problems that I'd like to sort out.

    1. Description is too long and there fore stretches conky across my whole screen. no ability to word wrap the rss feed
    2. the rss function in conky doesn't format so you end up with something like below in your conky including all symbols "<b>" etc
    Code:
    <p><b>Placid</b> (plac·id) <i>adj.</i>* 1. Satisfied; complacent.* 2. Undisturbed by tumult or disorder; calm or quiet.</p>
    So what I am wondering is does any1 have a way I could use either a bash script or curl to parse this info back into my conky script.

    Any help is appreciated (I am very new to scripting)
    Last edited by PantherStu; March 14th, 2013 at 01:27 AM. Reason: Marked solved

  2. #2
    Join Date
    Feb 2008
    Beans
    251
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Conky and Rss Feed

    Hey,

    You can definitely use Lua[1] or Bash[2] to process the RSS a little before displaying it. If I remember correctly, there is very good support for Lua scripts in Conky, and the language has a load of relevant features.. [3]

    Parsing RSS in bash might be a bit of a headache, although your needs aren't too complicated. Perhaps a simple solution might be easier![4]

    Hope that helps!
    Gp


    [1] http://www.lua.org/
    [2] http://how-to.wikia.com/wiki/How_to_...y/conky-rss.sh
    [3] http://stackoverflow.com/questions/6...ithin-a-string
    [4] http://stackoverflow.com/questions/4...a-shell-script

  3. #3
    Join Date
    Feb 2013
    Beans
    24

    Re: Conky and Rss Feed

    Beautiful, Thanks
    After reading through posts you linked to, this is what I ended up with in my conkyrc
    Code:
    Word of the Day
    ${hr}
    ${color}${font Sawasdee:bold:size=14}${rss http://www.wordthink.com/feed 300 item_titles 1}${font}
    ${execi 300  curl -s http://www.wordthink.com/feed/ | grep description |sed -e :a -e 's/<[^>]*>//g;/</N' |sed -e 's/[ \t]*//' |sed -e 's/\(.*\)/ \1/' |sed -e 's/\.//' |sed -e 's/\"//' |sed -e 's/\"//' |head -n $((1 + 2)) |tail -n $((1))|fold -s50}
    which looks like


    Thanks for all the help

  4. #4
    Join Date
    May 2012
    Location
    a planet far away
    Beans
    34
    Distro
    Ubuntu Studio 12.04 Precise Pangolin

    Re: Conky and Rss Feed

    imagine what it would look like if you had oxy-moronic pics in the background

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
  •