Okay, in Just Feed Me One Piece at a Time here’s a quick fix for how to get a single item RSS feed for each separate blog post on a WordPress blog…
…but first, the hint condition for those of you who want to work it out yourself: Features: RSS (WordPress.com).
Can you see what it is yet?
Here: If you go to your main site feed, and then add ?s=oogabooga to the end of the URL, it’ll show you a feed of just the posts that contain the word “oogabooga” in them. (This is called a search feed.)
So a “nearly there” solution is…
…go to the main site feed and use the title of the post you want the feed for as the search term.
Now this works fine if you never mention the exact title of the post in another post on the blog, because post titles are likely to be unique phrases (and so the search will only turn up one result)…
But if you do refer to one post using it exact title in another post, you’ll get multiple hits.
So a quick fix workaround is just to push the feed through a pipe that filters the results list by title:
(An alternative approach would be to use the heuristic that the first mention of the phrase will be in the original post (i.e. the post where the search phrase matches the post title), in which case you could just filter the search feed to return the oldest hit; in a pipe, the easiest way to do this would be to reverse the feed order, (or sort by ascending date) then truncate the feed after 1 item).)
Note that the workaround relies on the WordPress search doing its thing properly and the user getting the search term right…
For a useful workflow, it’d be handy to have a bookmarklet that would generate the URL for a single item RSS feed for a given WordPress blog feed (a bit like the OpenLearn single item RSS feed bookmarklet does for OpenLearn unit pages). This means capturing the blog top-level URL (e.g. https://ouseful.wordpress.com) and the post title. The following pipe attempts to do that just given the URL of the actual post you want the single feed item for (WordPress single item RSS from URl):
This pipe works for OUseful.info, but probably won’t work for a lot of other WordPress blogs because it uses a heuristic to capture the post title from the page title. More specifically, in the OUseful.info case, page titles have the form This is the Post Title « OUseful.Info, the blog…, so the pipe looks for the « then loses it and everything to the right of it in the page title to determine the post title.
What would be handy here would be for all WordPress templates to add a “title” metadata element to the header containing the exact post title..?
Though of course, it’d be nicer still if WordPress and the other blogging platforms made the single item RSS feed available for each post natively, just anyway… ;-)
PS it seems like WordPress does do such a thing…
So the general case solution to single item RSS feeds for WordPress blog posts is use the following construction:
Here’s a bookmarklet that I think should work on any WordPress blog…
And so the web just got a little bit more wired for me… Thanks, Shanta Rohse:-)
(Note that if the blog publisher has configured the feeds to only include summaries rather than full posts, you’ll only get the summary… Unless there’s a URI argument that will force the full item to be published (which I doubt!)?)
PPS it strikes me that you can add a link to the single item RSS feed for a WordPress post by adding something like this to the post (or sidebar, maybe, if your template has sidebar widgets alongside individual posts):
<a href=”?feed=rss2&withoutcomments=1″>Single item RSS feed for this post</a>
Like this: Single item RSS feed for this post
(I’m not sure whether that link will work from within a feed reader, though?)