21

This Geeklet displays news on your desktop from an RSS feed. You can specify the address of the feed, how many recent items to show, and a maximum length for each item.

Creating a script to parse a specific RSS feed is quite easy, but creating a script that will work with any feed is much more difficult. This is mainly because each feed often has its own subtle differences. I've tested the script in this Geeklet with loads of RSS feeds, and it works with pretty much all of them. There are bound to be some that don't work, so if you want me to take a look just post the feed address in the comments and I'll try and make it work. Also, if anyone can suggest any improvements, add them in the comments and I will update the script.

Download the Geeklet linked below and open it up in GeekTool. The first three lines of the command are:

URL="http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/technology/rss.xml"
maxLength="500"
start="3"
end="9"

The first line is to specify the RSS feed. "maxLength" is to set a maximum length to each item in the feed. "start" is to set how many paragraphs at the start of the feed you want to hide. This is useful for hiding the main title and description of the feed. "end" is to set how many items you want to show.

Screenshot

Geeklet files to download

Comments

User Avatar
macphotographytips 1622 days ago
I can’t get it to work with the following Macworld.com feed. Any suggestions? Hope I copied it right. Thanks for this site.

URL="feed://rss.macworld.com/macworld/feeds/main"

maxLength="500"

start="3"

end="9"

curl --silent "$URL" |

sed -e :a -e '$!N;s/n//;ta' |

sed -e 's//

/g' |

sed -e 's//

/g' |

sed -e 's//

/g' |

sed -e 's//

/g' |

grep -E '(title>|description>)' |

sed -n "$start,$"'p' |

sed -e 's///' |

sed -e 's///' |

sed -e 's// /' |

sed -e 's///' |

sed -e 's///g' |

sed -e 's/<//g' |

sed -e 's/]*>//g' |

cut -c 1-$maxLength |

head -$end |

sed G |

fmt
User Avatar
jprokos 1568 days ago
This works but taking a look at Activity Monitor shows that sed is using over half of my computer's processing power! Between 50 and 75%. I don't understand why?
User Avatar
Ptujec 1423 days ago
Hi, nice one. Thanks.

I just a problem with paragraphs.

Any advice?

http://cl.ly/3ngr

Thats the feed:

http://www.hradetzkys.de/rss/tageslosung-kompaktfeed.xml

Update: I also discovered that german characters like "äöü…" got killed
User Avatar
blingboy2win 1392 days ago
it would be really cool if you could do one that listens to carridge return or enter
User Avatar
mvrlondon 1267 days ago
Hi  Thanks for the code.  Most useful, but need help with this feed - http://newsrss.bbc.co.uk/weather/forecast/8/Next3DaysRSS.xml

It has the following code "°" to display the degree symbol for the temperature.  How do I get the geeklet to display the degree symbol instead of the code for it - right now I see "72°F" instead of "72°"

Thanks
User Avatar
JimGee 1174 days ago
Any help would be appreciated to enable carridge return. Otherwise great geeklet. Much appreciated.
User Avatar
alexgt84 1153 days ago
I downloaded your rss.glet and unfortunately I can't get it to work. I've even tried displaying your bbc rss and it still won't display anything. Any help would be great. Thanks.
User Avatar
subhash428 1134 days ago
currently i am using the latest version of Lion OS. i did according to u what u said above. it is totally not working for me......

Log in to comment or register here.