syndicated-media / sn-spec

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Link to item

Cj-Malone opened this issue · comments

I think there could be a bennifit to linking to a item within a feed. The only way I can see this working is a we decide a standardized field such as item or sm_item to try and avoid collisions.
Then when a compliment app gets a link that includes the field it can automatically go to that item.

So when clicking a link like https://example.org/feed/?item=GUID in a browser, the browser would continue to hand that link to the registered app for application/rss+xml that app would parse the feed and show the item.

After thinking about it I think a # / an anchor link would be a better fit, like https://example.org/feed/#GUID

XML already has this built-in. If an element has an id attribute, that element is accessible via that ID via the URL anchor. Thus, I think we can just say that <item id="foo"> is optional and recommended for linking and that foo must match the GUID. Of course, that means that the GUID has to be a valid XML ID, and we'd have to define a way to transliterate GUIDs to XML IDs.

@ziggythehamster what's the benefit of having the ID match the GUID? Other than the fact that they are both identifiers, they seem to be serving two distinct purposes.

I guess they don't actually have to match, but in my experience, some RSS parsers aren't actually very good XML parsers (which is why you see some clients get hung up on CDATA sections, or why you see people "working around" this by including unescaped HTML inside a <description> as if <b> tags were permitted RSS tags). Given this, I figured that you'd end up with some parsers doing the right XML thing by mapping #anchor to an element with id="anchor" and some parsers trying to resolve #anchor to a GUID. I would certainly prefer that we work in XML land, where #anchor maps to id="anchor" and the ID has no other meaning in the RSS format.