Showing posts with label rss. Show all posts
Showing posts with label rss. Show all posts

2009-01-28

rss2xmpp, a script to crosspost any feed to Jabber

Usage:
$ rss2xmpp.py feed-URL your-jabber-id
On the first run the script will complain that you have to put jabber settings in ~/.rss2xmpp. It writes an example for GoogleTalk there. Either RSS or Atom feeds should work.

Requirements: FeedParser, html2text, and xmpppy, and Python, of course.

The script itself is in the BitBucket: rss2xmpp.py.

BTW, I discovered, that BitBucket not only provides free OpenSource hosting for mercurial repositories, but has free SSH access and allows one private repository per account.

See also:

Скрипт rss2xmpp, кросспост чего угодно в Jabber (this post in Russian)

2008-02-05

How to parse RSS 2.0 in bash

It is quite easy to use information from RSS feeds in bash scripts. I use xmlstarlet to work with XML in the shell. For example, to print the latest titles and links from my RSS feed, I can do:
RSS_URL=http://feeds.feedburner.com/usefreetools
wget ${RSS_URL} -O - 2>/dev/null | \
xmlstarlet sel -t -m "/rss/channel/item" \
  -v "guid" -n -v "pubDate" -n -v "title" -n -v "link" -n -n
Alternatively, I can use curl -g ${RSS_URL} -s instead of wget. I could have added -v "description" to see the contents of my posts.