Notes about Blogger and WordPress web feed requests and feed formats
Last updated on 31 Mar. 2024
Common web feed formats
https://en.wikipedia.org/wiki/Web_feed states that the following are the common web feed formats:
- Atom, https://en.wikipedia.org/wiki/Atom_(web_standard)
- JSON Feed, https://en.wikipedia.org/wiki/JSON_Feed
- RSS, https://en.wikipedia.org/wiki/RSS
Blogger uses Atom 1.0 feed format by default
Complete Guide to RSS Feed on Blogspot, https://www.innateblogger.com/2021/08/rss-feed-on-blogspot.html states that a feed URL like https://ravisiyer.blogspot.com/feeds/posts/default will use Atom 1.0 format. To make it use RSS 2.0 format, ?alt=rss has to be added to end of URL like https://ravisiyer.blogspot.com/feeds/posts/default?alt=rss.
Hmm. I did not know or did not recall that it was so simple to get Blogger blog feeds in RSS 2.0, which is the default format used by WordPress.
Blogger Reference Guide, https://developers.google.com/blogger/docs/2.0/reference has the "Blogger query parameters reference" section, which states, "The Blogger Data API supports almost all of the standard Google Data API query parameters". The latter link is exhaustive and very impressive. But this is 2.0 API and not the latest.
3.0 API seems to be based on REST API. Relevant 3.0 API links: Introduction and Getting Started. I think it needs an API Key, and so is not so straightforward to use like web feed.
WordPress uses RSS 2.0 feed format by default
Find Your RSS Feed, https://wordpress.com/support/feeds/ : It clearly states, "Every WordPress.com website has an RSS feed built-in." ... "To view the RSS feed URL of your site, add /feed/ to the end of your website’s URL."
The first line returned on requesting https://ravisiyer.wordpress.com/2022/feed/ is '<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"'. So default format used by WordPress feed is RSS 2.0.
About RSS 2.0 format: https://www.w3schools.com/xml/xml_rss.asp
https://wordpress.com/support/feeds/ states, "If you wish to use an Atom feed, you can do so by appending /atom/ to the end of your feed address:". Initial lines returned by https://ravisiyer.wordpress.com/2022/feed/atom/ are:
xmlns="http://www.w3.org/2005/Atom"'
As simple as that! I had not known or remembered this either.
I could not find an equivalent in WordPress to Google Data API query parameters.
WordPress has a REST API. Related links: REST API Handbook, Using the REST API and Key Concepts. It seems that it needs a plug-in to work and plug-ins don't seem to be supported for free plans which is what I use for my WordPress blogs.
RSS compared with Atom
https://en.wikipedia.org/wiki/RSS#RSS_compared_with_Atom has a small but useful comparison.
Does RSS pick up a recently updated blog post as one of the latest posts?
From: RSS feeds and updating a post, https://wordpress.com/forums/topic/rss-feeds-and-updating-a-post/ :
"If we updated old blog content, will the automatic RSS email register it as a "new" post? Or will I have to unpublish the post, update it, and republish it?"
"You will have to unpblish the post, update it and will have to publish it again first. Then after this also it will not be considered as a new post. (keeping the fact that you don't change the URL of the post and it is recommended to not to do so in order to not making your blog a duplicate one)."
max-results Query String parameter supported by Blogger web feed; No WordPress equivalent, it seems
- Blogger blogs provide blog feed as JSON if appropriate query string parameter is passed in the request (alt=json)
- WordPress blog feed is in XML by default. To get it in JSON one needs to use a plugin (in target WordPress blog) but plugins need a WordPress business plan.
- Converting (WordPress feed) XML to JSON through code: Google Apps. Script solution: https://www.labnol.org/code/19952-convert-xml-to-json which worked for me. Some JavaScript solutions are mentioned in: https://stackoverflow.com/questions/1773550/convert-xml-to-json-and-back-using-javascript but I could not get it to work (then - in or around July 2023; perhaps I should relook them now/later if needed).
Comments
Post a Comment