Update: For the latest version and up to date documentation, please see the project page.
feed2omb is a simple tool that takes input from Atom or RSS feeds and posts updates to the open microblogging service of your choice. It should also (though I’m not going to try it) quite happily post to Twitter.
The feed reading is handled by Mark Pilgrim’s excellent Universal Feed Parser so it should be able to deal with any feed you throw at it. On the posting side, you can send the updates to open microblogging services such as those based on Laconica – this includes Identica.
Installation:
You should be able to run this on any operating system where you can install Python (tested with 2.5). In addition to feed2omb itself, you need the Universal Feed Parser and ConfigObj. Both dependencies can either be installed properly or just placed in the same directory as feed2omb.
Usage:
Create one or more config files (one for each feed) using the sample.config file as an example.
Run feed2omb.py --update --test yours.config to check everything is working. This will not post anything, but just output the new messages it finds. If everything looks good, you can run again with the –test option and schedule this to run on a regular basis.
You can specify as many config files as you need – each will be processed in turn. For help on the command line, use feed2omb.py --help.
Other Options
Instead of --update, you can specify --eat. In this case, new messages found will be marked as sent, but will not actually be sent. This is useful when setting up a new feed, to prevent the sending of lots of old items.
The --max restricts processing to a specified number of items per run. For example, specify --max=1 to only process one item. When set up this way, even if there are multiple new items in the feed, only one (the oldest) will be processed on each run. This can be used to avoid flooding the omb service with a batch of messages all at once.
FAQ:
Q: Now twitterfeed.com supports Laconica, why not just use that or something like it?
A: That would be easier, but: a) you have to give it your account details, b) it’s not ‘open’ and you can’t customise it, and c) you might be running a private Laconica instance on a non-public network.
Q: Where’s the source code?
A: In the zipped download (see above), or you can browse the git repository or clone it using git from there – e.g.:
git clone http://git.ciarang.com/feed2omb.git |
Q: What license is this released under?
A: AGPL v3
Q: Can it output the author’s name along with the entry’s title?
A: Yes, version 0.5 adds a ‘msgmode’ setting to the config file. With this set to ‘title’ (the default) just the entry’s title is sent. Setting it to ‘authtitle’ sends the author’s name followed by the title – this is useful for feeds with multiple authors, or aggregated feeds such as those sourced from a Planet installation.
Q: Why isn’t my question answered here?
A: You haven’t asked it yet. Ask me.
-
Working great apart from a little UTF-8 encoding it seems? =)
–snip–
Found new entry: http://www.digi.no/php/art.php?id=784334
Sending new message:
Traceback (most recent call last):
File “feed2omb.py”, line 68, in ?
print ‘ ‘+text
UnicodeEncodeError: ‘ascii’ codec can’t encode character u’\xf8′ in position 15: ordinal not in range(128)
–snip– -
The .no chars are displayed upon -u -t, as well as -u now. So its progress since it didnt show æøå in konsoll upon fetching in v0.2.
Ive tried this on Ubuntu (gutsy & hardy), and Gentoo, same locales.
–snip–
Sending new message:
Kraftig fartsøkning for populært minnekort – http://bit.ly/Vk5QK
Traceback (most recent call last):
File “feed2omb.py”, line 80, in
resp=opener.open(config['apibaseurl']+’/statuses/update.xml’,urlencode(data))
File “/usr/lib/python2.5/urllib.py”, line 1250, in urlencode
v = quote_plus(str(v))
UnicodeEncodeError: ‘ascii’ codec can’t encode character u’\xf8′ in position 13: ordinal not in range(128)
–snip–root@fun:~/feed2omb# locale -a
C
en_AU.utf8
en_BW.utf8
en_CA.utf8
en_DK.utf8
en_GB.utf8
en_HK.utf8
en_IE.utf8
en_IN
en_NZ.utf8
en_PH.utf8
en_SG.utf8
en_US.utf8
en_ZA.utf8
en_ZW.utf8
it_CH.utf8
it_IT.utf8
nb_NO.utf8
no_NO.utf8
POSIX
—-So you have working posting with a .no feed in your setup?
http://digi.no/rss is the feed Im pulling above, thanx for the respons & work you have done! =) -
Superb! All works, thanx. =)
-
@Børge no I was just testing various .no RSS feeds. =)
I can be found at; http://fun.ohhh.no/hz primarly.
-
I have no idea, Im a man that hates borders. =)
-
mibbul@kek:~$ python /home/XXX/feed2omb/feed2omb.py –update –test identica.config
feed2omb version 0.5
Copyright 2008 Ciaran GultnieksReading config: identica.config
Reading feed…
Traceback (most recent call last):
File “/home/XXX/feed2omb/feed2omb.py”, line 64, in ?
feed=feedparser.parse(config['feedurl'])
File “/home/XXX/feed2omb/configobj.py”, line 580, in __getitem__
val = dict.__getitem__(self, key)
KeyError: ‘feedurl’Help!
-
Thank you very musch for the application.
I am trying to add RSS feed like this ‘feedurl = feed://feeds.feedburner.com/bla-bla-bla‘ and getting following output:
% Reading config: cars.config
% Reading feed…
% Finished
… and nothing
Does ConfigObj supprort ‘feed://’. I changed feed to http and getting error in feedparser module.
What am I doing wrong? -
Error msg:
Traceback (most recent call last):
File “feed2omb.py”, line 243, in
(t_year,t_month,t_day,t_hour,t_minute,t_second,t_x,t_x1,t_x2)=entry.updated_parsed
File “/Users/alex/Desktop/feed2omb/extlib/feedparser/feedparser.py”, line 236, in __getattr__
raise AttributeError, “object has no attribute ‘%s’” % key
AttributeError: object has no attribute ‘updated_parsed’Feed url here _http://bit.ly/bBPDqN
P.S. Regarding ‘feed://’ – I use Safari browser and it changed ‘http’ to ‘feed’ and opened the fedd itself
-
Thank you for help – it works!
I have one more question: is it possible to form the OMB message from few fields, i.e. title+summary?
And one more suggestion: to add some variable, where users could store some static text like tags or groups and add them to the end of msg. I am do this with RegExp’s, but it requer some knowledge of them and I am not sure everyone can use it so easy
-
Hi
I am testing feed2omb and got this error with any feed I try.
Reading feed…
Traceback (most recent call last):
File “feed2omb.py”, line 238, in ?
for entry in reversed(feed.entries):
NameError: name ‘reversed’ is not definedIt’s a DH shared hosting.
-
It was a python version problem. Sorry.
-
Hi again
I dont know why but… shortener is not working. I tried with all availables values.
What it could be? -
Ok, I missed the part where the shortener works only when the message its oversized, sorry.

29 comments
Comments feed for this article
Trackback link: http://ciarang.com/posts/feed2omb/trackback