Jetpack: Reader Integration: Add ids to RSS feed

Created on 12 Aug 2014  路  8Comments  路  Source: Automattic/jetpack

Per @blowery, it would be helpful for the WordPress.com Reader if feeds from Jetpack sites included the blog ID as metadata in the feed to confirm that site is a Jetpack site.

This would aid the Reader to understand if any of the WP.com data can be trusted or used for hints or if a site was previously a JP site, now no longer.

General [Type] Enhancement

Most helpful comment

I'm going to take this on, aiming for 4.2.

All 8 comments

Yup. Was thinking something like <site xmlns="com-wordpress:feed-additions:1">1234</site> inside the rss/channel element for an RSS feed and the feed element of an Atom feed. The namespace here is something I just made up, so feel free to use something more sane.

I'd rather have the data inside the actual feed rather than as a X-Jetpack-SiteId HTTP header because the feed contents should survive things like Feedburner and the like.

Additionally, having the post id in each item would be super handy. Something like <post-id xmlns="com-wordpress:feed-additions:1">1234</post-id>. Right now we're parsing the guid, which works most of the time, but something more explicit would be great.

I'm going to take this on, aiming for 4.2.

@blowery wrote this, but it doesn't seem like anyone took him up on the advice:

The namespace here is something I just made up, so feel free to use something more sane.

The way the namespace is defined makes it the default namespace and can break parsers (as was my case with a Drupal module recently). Can this namespace be defined with a proper prefix? Something like:
xmlns:automattic="com-wordpress:feed-additions:1"

@sdellis I admit I know not nearly enough about XML Namespacing. Opened a new issue at https://github.com/Automattic/jetpack/issues/5219 for this.

The way the namespace is defined makes it the default namespace and can break parsers (as was my case with a Drupal module recently).

@sdellis An xmlns declaration only applies to the declaring element and that element's descendants. In our case, there are no descendants, so the namespace only applies to the site and post-id elements, not any other elements in the feed. If an xml parser is applying it as the default namespace up the element tree, that parser is in violation of the xml + namespaces spec...

Unless I'm missing something? Do you have an example showing how it broke something?

My apologies. You are correct, @blowery, and this seems like a bug in the way the Drupal Feeds XPath Parser module determines default namespaces. Here's an example of where it's falling down in that module. Feel free to close #5219 @kraftbj. I will report the bug over there. Sorry for the false alarm, and thanks for your feedback!

@sdellis no worries! For a bit there I was really quite worried. It'd been a while since I read the XML 1.1 spec.

:D

Was this page helpful?
0 / 5 - 0 ratings