blog:use_rss_feeds_with_conky
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| blog:use_rss_feeds_with_conky [2010-06-16 18:54] – brb | blog:use_rss_feeds_with_conky [2010-06-23 08:35] (current) – brb | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| A simple shell script and the ascii2uni tool is all it takes to add RSS feeds to conky. | A simple shell script and the ascii2uni tool is all it takes to add RSS feeds to conky. | ||
| - | Create a shell script | + | 1. Add this line to your .conkyrc, adapting the path of the script |
| <code bash> | <code bash> | ||
| - | # | + | ${execi 300 /home/brb/bin/ |
| - | # RSS Display Script by Bill Woodford (admin@sdesign.us) v1.0 | + | |
| - | # | + | |
| - | # This script is designed to output story titles for most any RSS Feed. | + | |
| - | # | + | |
| - | # This script depends on curl. Please ensure it is installed and in your $PATH | + | |
| - | # Gentoo: emerge -av net-misc/ | + | |
| - | # Debian: apt-get install curl | + | |
| - | # Homepage: http:// | + | |
| - | # | + | |
| - | # Usage: | + | |
| - | # .conkyrc: | + | |
| - | # URI = Location of feed, ex. http:// | + | |
| - | # LINES = How many titles to display (default 5) | + | |
| - | # TITLENUM = How many times the title of the feed itself is specified, usually 1 or 2 (default 2) | + | |
| - | # | + | |
| - | # Usage Example | + | |
| - | # ${execi 300 /home/youruser/scripts/ | + | |
| - | + | ||
| - | #RSS Setup - Don't change unless you want these values hard-coded! | + | |
| - | uri=$1 # | + | |
| - | lines=$2 # | + | |
| - | titlenum=$3 # | + | |
| - | + | ||
| - | #Script start | + | |
| - | # | + | |
| - | if [[ " | + | |
| - | echo "No URI specified, cannot continue!" | + | |
| - | echo " | + | |
| - | else | + | |
| - | #Set defaults if none specified | + | |
| - | if [[ $lines == "" | + | |
| - | if [[ $titlenum == "" | + | |
| - | + | ||
| - | #The actual work | + | |
| - | curl -s --connect-timeout 30 $uri |\ | + | |
| - | sed -e ' | + | |
| - | grep -o '< | + | |
| - | sed -e ' | + | |
| - | head -n $(($lines + $titlenum)) |\ | + | |
| - | tail -n $(($lines)) | + | |
| - | fi | + | |
| </ | </ | ||
| - | Add this line to your .conkyrc: | + | 2. Create a shell script in a folder like $HOME/bin: [[: |
| - | <code bash> | + | |
| - | ${execi 180 /home/brb/bin/conky-rss.sh http:// | + | |
| - | </ | + | |
| - | + | ||
| - | {{tag>}} | + | Ref: http:// |
| + | {{tag>ubuntu linux rss conky}} | ||
| ~~LINKBACK~~ | ~~LINKBACK~~ | ||
| ~~DISCUSSION~~ | ~~DISCUSSION~~ | ||
blog/use_rss_feeds_with_conky.1276707294.txt.gz · Last modified: 2010-06-16 18:54 by brb
