Welcome
Welcome to antiX-forum.

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, join our community today!

RSS in Conky

Post your tips and tricks here.

RSS in Conky

Postby Jerry on Tue May 13, 2008 4:05 pm

Along the line of practical items, I have adapted this script to display the current top item on CNN.com in Conky. (It requires the installation of curl from the repos.) My procedure (be sure to change my username "jb" to your own):

1) Open up Leafpad and paste in this code:
Code: Select all
# RSS Feed Display Script by Hellf[i]re v0.1
#
# This script is designed for most any RSS Feed. As some feeds may not be
# completely compliant, it may need a bit of tweaking
#
# This script depends on curl.
# Gentoo: emerge -av net-misc/curl
# Debian: apt-get install curl
# Homepage: http://curl.haxx.se/
#
# Usage:
# .conkyrc: ${execi [time] /path/to/script/conky-rss.sh}
#
# Usage Example
# ${execi 300 /home/youruser/scripts/conky-rss.sh}

#RSS Setup
URI=http://rss.cnn.com/rss/cnn_topstories.rss #URI of RSS Feed
LINES=1 #Number of headlines

#Environment Setup
EXEC="/usr/bin/curl -s" #Path to curl

#Work Start
$EXEC $URI | grep title |\
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 $(($LINES + 2)) |\
tail -n $(($LINES))

Change LINES= to as many feeds as you would like displayed.
2) save as conky-rss_CNN.sh in /home/jb/scripts , then right-click --> Permissions and click Yes to make it executable
3) paste the following at the bottom of conkyrc (colors personal):
Code: Select all
${color white}News:
${color green}${execi 300 /home/jb/scripts/conky-rss_CNN.sh}

Then save the file.
4) click Menu --> WM's --> Conky on/off twice to activate new config

NOTES: 1) You can add other feeds by creating additional copies of the script and changing the URL and the name. 2) Not all feeds work for me, especially those ending in xml such as from the BBC--maybe somebody can solve that?
Jerry
 
Posts: 162
Joined: Wed Sep 12, 2007 5:55 pm

Postby JawsThemeSwimming428 on Tue May 13, 2008 11:45 pm

Thanks, I plan to try that later tonight. Nice job.
JawsThemeSwimming428
 
Posts: 133
Joined: Mon Mar 17, 2008 2:28 am

Postby JawsThemeSwimming428 on Wed May 14, 2008 4:23 am

OK, not sure why it doesn't work with feeds ending in .xml but I am getting the same result as you. At first it wasn't working but then I realized I hadn't installed curl. After installing curl everything worked fine. The only question I have is how do I allow the headline to take up more than one line in conky? For example, right now it says "Philadelphia's municipal WiFi n" and then it cuts it off because there is a character or line limit. I want it to show the entire title of the article. Thanks !
JawsThemeSwimming428
 
Posts: 133
Joined: Mon Mar 17, 2008 2:28 am

Postby Jerry on Wed May 14, 2008 1:21 pm

I found that you can get a certain increase in width by changing this entry in your conkyrc file:
Code: Select all
maximum_width 300

But numbers greater than that seem to have no further effect. Something else must be limiting it, haven't figured out what yet.
Jerry
 
Posts: 162
Joined: Wed Sep 12, 2007 5:55 pm

Postby JawsThemeSwimming428 on Wed May 14, 2008 5:18 pm

Alright thanks. I will play around a little bit and let you know if I figure it out.
JawsThemeSwimming428
 
Posts: 133
Joined: Mon Mar 17, 2008 2:28 am


Return to Tips and Tricks

Who is online

Users browsing this forum: No registered users and 1 guest

cron