Added Page Having Dynamically Generated List Of All Posts On My Blogger Blogs Using Shared Javascript code
Does Blogger API say that it could return less than max results even if more posts than max results match the request?
Yes, the Blogger API (specifically the older Data API v2.0, which you're using with alt=json-in-script
) can and often does return fewer results than max-results
, especially if it hits the end of available results, or if there's an internal limit/issue.
Here's a breakdown of what's likely happening and why your posts are being omitted:
Invisible/Soft Limit (Most Likely): While
max-results
allows you to request up to 500 (or sometimes 999 depending on the feed type), there seems to be an undocumented or "soft" internal limit on how many posts the summary feed (/feeds/posts/summary
) will return for a blog, particularly for older blogs or those with specific content types. Many developers have reported that this feed often stops returning posts after a certain number (e.g., around 50-100 posts, or a specific date range), regardless of how highmax-results
orstart-index
are set.Deprecation of Data API v2.0: The Blogger Data API v2.0 (which
alt=json-in-script
relies on) was officially deprecated by Google and has been largely replaced by Blogger API v3.0. Although Google stated that some GET requests (like feeds) would continue to be supported, they also mentioned "minor differences in their behavior" and encouraged migration. It's highly probable that this "minor difference" includes a reduced reliability or implicit limit on how many historical posts the v2 feeds will expose.
After this change, I saw that the Archive gadget functionality gave a limited view of archived posts in one view as compared to what the Archive gadget did with 'Simple Bold' theme. You could usually see only one month's posts in one view and had to click a button to see another month's view at which time the previously selected month's posts would not be shown. I very much wanted to provide visitors to my blog, as well as myself, an easy way to see a list of all posts in the blog which is dynamically generated through a gadget or otherwise. A few days back I came across some Javascript code solutions for this need. Yesterday (23rd Jun 2023), I was able to successfully implement one of these solutions to both the above mentioned blogs.
As both my blogs have over a thousand posts, the Javascript code takes time to execute and sometimes the page load (dynamically generated list) gets completed very slowly.
You can view the "List of Posts in Blog In Reverse Chronological Order - Dynamically Generated" in the two blogs here:
1) (This) Worldly blog: https://ravisiyermisc.blogspot.com/p/list-of-posts-in-blog-in-reverse.html
2) Spiritual blog: https://ravisiyer.blogspot.com/p/list-of-posts-in-blog-in-reverse.html
I also created a "Static Copy of List of Posts in Blog In Reverse Chronological Order taken on 23 June 2023" for both the blogs. These static pages load faster as they have the list of posts as HTML. You can view them here:
1) (This) Worldly blog: https://ravisiyermisc.blogspot.com/p/static-copy-of-list-of-posts-in-blog-in_23.html
2) Spiritual blog: https://ravisiyer.blogspot.com/p/static-copy-of-list-of-posts-in-blog-in.html
The Javascript provided in the dynamically generated list pages mentioned earlier (not static pages which have the generated HTML for the list of posts) is from the post titled, "Create an Archive List/Page for Blogger", https://www.sarwrites.com/2015/09/create-archive-listpage-for-blogger.html , created in Sept. 2015 and last updated on August 2018. Many thanks to the author of the post. I also came across an error in the script which has already been pointed out by Anonymous comment dated April 25, 2018 about "601+150=751 not 851". I fixed the error and now the script works.
I thought it may help some if I provide the entire HTML including script for the above dynamically generated list pages. But I am not sure about the copyright status of the original code and so decided not to put up the HTML and script code on this post.
Comments
Post a Comment