homeGeek CultureWebstoreeCards!Forums!Joy of Tech!AY2K!webcam

The Geek Culture Forums


Post New Topic  New Poll  Post A Reply
my profile | directory login | | search | faq | forum home
  next oldest topic   next newest topic
» The Geek Culture Forums   » Other Geeky Stuff   » Ask a Geek!   » Torsmo and RSS

 - UBBFriend: Email this page to someone!    
Author Topic: Torsmo and RSS
GameMaster
BlabberMouth, a Blabber Odyssey
Member # 1173

Member Rated:
4
Icon 1 posted February 28, 2007 19:39      Profile for GameMaster   Author's Homepage     Send New Private Message       Edit/Delete Post   Reply With Quote 
Anyone have a good way to get RSS into torsmo? I have a script to get RSS to plain console text, but some links are still not striped correctly.

--------------------
My Site

Posts: 3038 | From: State of insanity | Registered: Mar 2002  |  IP: Logged
GameMaster
BlabberMouth, a Blabber Odyssey
Member # 1173

Member Rated:
4
Icon 1 posted February 28, 2007 19:49      Profile for GameMaster   Author's Homepage     Send New Private Message       Edit/Delete Post   Reply With Quote 
Never mind, found a script:

code:
#!/bin/bash
# RSS Display Script by Bill Woodford ([email protected]) 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/curl
# Debian: apt-get install curl
# Homepage: http://curl.haxx.se/
#
# Usage:
# .conkyrc: ${execi [time] /path/to/script/conky-rss.sh URI LINES TITLENUM}
# URI = Location of feed, ex. http://www.gentoo.org/rdf/en/glsa-index.rdf
# 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/conky-rss.sh http://www.foxnews.com/xmlfeed/rss/0,4313,1,00.rss 4 2}

#RSS Setup - Don't change unless you want these values hard-coded!
uri=$1 #URI of RSS Feed
lines=$2 #Number of headlines
titlenum=$3 #Number of extra titles

#Script start
#Require a uri, as a minimum
if [[ "$uri" == "" ]]; then
echo "No URI specified, cannot continue!" >&2
echo "Please read script for more information" >&2
else
#Set defaults if none specified
if [[ $lines == "" ]]; then lines=5 ; fi
if [[ $titlenum == "" ]]; then titlenum=2 ; fi

#The actual work
curl -s --connect-timeout 30 $uri |\
sed -e 's/<\/title>/\n/g' |\
grep -o '<title>.*' |\
sed -e 's/<title>//' |\
head -n $(($lines + $titlenum)) |\
tail -n $(($lines))
fi



--------------------
My Site

Posts: 3038 | From: State of insanity | Registered: Mar 2002  |  IP: Logged
dragonman97

SuperFan!
Member # 780

Member Rated:
4
Icon 1 posted February 28, 2007 21:21      Profile for dragonman97   Author's Homepage     Send New Private Message       Edit/Delete Post   Reply With Quote 
Oooh...that looks interesting. Currently, for a pet project, I'm using this:

http://feedparser.org/

(And I'm not really a Python programmer, but I can call it from a shell script to do my bidding.)

--------------------
There are three things you can be sure of in life: Death, taxes, and reading about fake illnesses online...

Posts: 9331 | From: Westchester County, New York | Registered: May 2001  |  IP: Logged
GameMaster
BlabberMouth, a Blabber Odyssey
Member # 1173

Member Rated:
4
Icon 1 posted February 28, 2007 22:09      Profile for GameMaster   Author's Homepage     Send New Private Message       Edit/Delete Post   Reply With Quote 
Well, I've been using torsmo for a while (since I found Damn Small Linux), and have set it to display all sorts of useful info like time, cal, mail (how many, and from who), system stats... And the next logical step was RSS feeds. which are now working thanks to the script above. I wish Torsmo handled links and launchers... I wonder if the newer fork (Conky) does -- now I'll have to look into that.

--------------------
My Site

Posts: 3038 | From: State of insanity | Registered: Mar 2002  |  IP: Logged


All times are Eastern Time  
Post New Topic  New Poll  Post A Reply Close Topic    Move Topic    Delete Topic next oldest topic   next newest topic
 - Printer-friendly view of this topic
Hop To:

Contact Us | Geek Culture Home Page

2015 Geek Culture

Powered by Infopop Corporation
UBB.classicTM 6.4.0



homeGeek CultureWebstoreeCards!Forums!Joy of Tech!AY2K!webcam