Support id/guid #3

Closed
gardnermj opened this Issue Jul 12, 2012 · 3 comments

Comments

Projects
None yet
2 participants

Could you add support for the id/guid tag? Not all feeds include them, but when they do it's quite handy.

It would be nice to have a built-in way to access entries by id too, but all I really need is an :id key in the entry struct.

Owner

scsibug commented Jul 13, 2012

The :link and :uri keys will probably give you what you are looking for. ROME (the underlying library that actually performs feed parsing) tries to reconcile id/guid in the many different feed formats into a URI.

For an Atom feed, you should find the feed and entry "id" element accessible from the :uri key. For RSS, the guid may be available via either the :link or :uri, but the logic governing that is more complicated.

See this reference for precise details on how this mapping is accomplished in ROME: http://wiki.java.net/bin/view/Javawsxml/Rome05URIMapping

Please let me know if this ends up working out for you. Thank you!

Yes, that's very helpful. I'm not sure I understand your comment about RSS's GUID, though; my reading of the linked document is that if there's a GUID for an RSS (0.94+) feed entry, then it will always be used as the uri for that entry (though it may also be used as the link). So in my understanding: if there's an ID of some sort, :uri will be it. Is this correct?

Thanks for the response!

Owner

scsibug commented Jul 15, 2012

You are right, the GUID may be available from both :link/:uri (not "either" as I originally commented).

My understanding is the same as yours: :uri will always contain an identifier (if one existed in the feed/entry).

scsibug closed this in fbe07e2 Jul 15, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment