L&LR staff blog

Sharing information about our work at the University.

Hacking our EPrints RSS feed to create author publication lists (slight return)

7 comments

Joss Winn from the University’s Centre for Educational Research & Development has already explained how to generate some code which creates a dynamic list of an author’s publications, drawing on an RSS feed of items in our Repository, for embedding in another webpage (e.g.  a staff profile page on the University’s website).

(Upfront, I’ll say this – I agree that it would be much better if we could do this with one click of an ‘embed my list‘ button. Until that day arrives…)

But: there’s a problem with the RSS feeds that come out of the EPrints software:

The items in the list don’t appear in any particularly logical order, and the order can’t be changed. (In fact, they’re displayed in reverse order by the date they were added to the Repository, which has its own internal logic, but makes no sense ‘in the wild’.)

To compound this problem, the actual date of publication is buried rather deeply within the item description, e.g.:

Neary, Mike and Winn, Joss (2009) The student as producer: reinventing the student experience in higher education. In: The future of higher education: policy, pedagogy and the student experience. Continuum, London, pp. 192-210. ISBN 1847064728 (In Press)

The challenge is to extract this date of publication and use it to re-order the items in the list.

I’ve used Yahoo! Pipes to do this, by:

  1. Copying the description into a new field.
  2. Using the following Regex to isolate and extract the date of publication: ^.*\((\d{4})\).*$
  3. Re-ordering the field by this date (in reverse order).

You can find the Pipe at: http://pipes.yahoo.com/lincoln/eprints_sort2

(Image: screenshot of the Yahoo! Pipe)

The final enhancement – I added user-input fields to allow you to use the Pipe to create a feed for any author (forename/surname), which can be further refined by adding an extra keyword (we’re using additional keywords, added to the EPrints record, as a secondary hack to distinguish between multiple authors with the same name!).

Once the Pipe has run, you can grab the RSS feed and pass it through Feed2JS in the usual way.

This isn’t particularly satisfactory in the long run, in that it relies on a lot of external services over which we have no control, but it’s a useful hack for now.

Written by Paul Stainthorp

March 3rd, 2010 at 2:38 pm

7 Responses to 'Hacking our EPrints RSS feed to create author publication lists (slight return)'

Subscribe to comments with RSS or TrackBack to 'Hacking our EPrints RSS feed to create author publication lists (slight return)'.

  1. There is some more discussion about using RSS feeds from ePrints at http://www.open.ac.uk/blogs/ORO/?p=55 – nothing as practical as you’ve done here, but a good exploration of the issues…

    Owen Stephens

    3 Mar 10 at 2:50 pm     

  2. An RSS feed describes the latest entries added to some kind of information environment. What you want is a feed that describes the latest entries added to “the literature”, irrespective of when they appeared in the information environment. It’s an ontological mismatch. And it’s a bummer.

    Literally what the RSS export plugin does is take a list of EPrints (such as a list of search results) and explicitly reorder by the “datestamp” metadata field. (That is, the most recent date that the metadata was altered.) It then iterates through that list, stopping after 10 results. In other words, RSS is a non-standard export plugin – it imposes “feed” semantics on what could be a format serialisation. And it doesn’t have any parameters to control the size of the output or the sorting conditions.

    However, earlier this week Chris promised to make me a variant RSS plugin that does have those parameters. I will make sure that we put a copy up on files.eprints.org.

    Les Carr

    3 Mar 10 at 9:20 pm     

  3. Wow that’s a lot of work to work around us! Les Carr asked me to produce this plugin: http://files.eprints.org/492/

    It allows you to export ALL items, via RSS in the sort order you want. It’s currently got ‘abstract’ as the description rather than the citation, but that’s easy to tweak.

    Christopher Gutteridge

    3 Mar 10 at 10:30 pm     

  4. Thanks, Les and Chris. This really helps. I’ve asked Tim at EPrints Services to install this plugin for us.

    Avatar of Joss Winn

    Joss Winn

    4 Mar 10 at 10:25 am     

  5. I wonder why people still provide RSS – isn’t ATOM better specified, easier to produce and supported by all the readers and software libraries anyway? Why not just provide Atom even if you label it RSS for people?

    Peter Sefton

    4 Mar 10 at 11:01 am     

  6. In our case, that’s very simple. It’s really easy to produce both. Atom *is* better, but a large number of tools only understand RSS1.0

    Christopher Gutteridge

    4 Mar 10 at 11:08 am     

  7. Just to add that EPrints Services have implemented Chris’ plugin on our repo and it works a treat. Thanks everyone.

    Avatar of Joss Winn

    Joss Winn

    5 Mar 10 at 2:19 pm     

Leave a Reply