[OAI-implementers] oai2xmpp

Ed Summers ehs at pobox.com
Thu Sep 24 00:24:23 EDT 2009

As an experiment to learn more about XMPP I created a little utility
that will poll an oai-pmh server and send new records as a chunk of
xml over XMPP.  The idea wasn't necessarily to see all the xml coming
into your jabber client (although you can do that), but to enable
downstream applications to have records pushed to them, instead of
them constantly having to poll for updates. So for example you could
create an archiver that sat and listened for new updates, or a current
awareness bot that scanned for articles that matched some user
profile, etc...

For example you can:

  oai2xmpp.py http://www.doaj.org/oai.article from at example.com to at example.org

which would poll DOAJ for new articles every 10 minutes and send them
via xmpp to to at example.org. You can adjust the poll interval, and
limit to records within a particular set with the --pollinterval and
--set options, e.g.:

  oai2xmpp.py http://export.arxiv.org/oai2 currents at jabber.org
ehs at jabber.org --set cs --pollinterval 86400

It's a one file python hack in the spirit of Thom Hickey's 2PageOAI
[1] that has a few dependencies documented in the file (lxml, xmpppy,
httplib2). You can find it here:


Which is actually a bazaar repository that you can branch if you like:

  bzr branch http://inkdroid.org/bzr/currents

If you try it out, have an improvements, or ideas let me know. There's
a short TODO section in the file's documentation that describes some
potential things that could be done.


[1] http://www.oclc.org/research/software/oai/2page.htm

More information about the OAI-implementers mailing list