3

I'm running conky with desktop RSS. Is it possible to limit the max length of its title?

I have something like this in my config:

${rss XXX 30 item_title 4}${goto 600}${rss YYY 30 item_title 4}

So it would be crucial that the first rss title won't exceed 600 in length, is it possible to limit that?

1

Looking at the docs I don't see a way to do it using rss.

Obviously with Conky you could write your own parser and use the execi. You could use curl or perhaps use this script instead, How to add an RSS feed to Conky/conky-rss.sh.

excerpt conky-rss.sh

# 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://www.foxnews.com/xmlfeed/rss/0,4313,1,00.rss #URI of RSS Feed
LINES=6 #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))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.