What could be the reason for the sudden lack of content from the Blogger API?

For weeks, I've been using the Google API to retrieve JSON data from my Blogger account and showcase and style blog posts on my personal website.

Everything was functioning flawlessly until yesterday when, out of the blue, the content section stopped displaying. The title, update (the post's update date), and the id are all being returned as usual. It's just the content that is no longer appearing.

I haven't made any changes to the code since I first implemented it, and after checking documentation for any API modifications, I came up empty-handed. So, I'm completely perplexed as to why this particular part of the code would suddenly cease to function.

This snippet of Javascript below represents most of what I use to obtain the JSON data. Do you see anything incorrect with it?

function init() {
    // Fetch your API key from http://code.google.com/apis/console
    gapi.client.setApiKey('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
    // Load the Blogger JSON API
    gapi.client.load('blogger', 'v3', function() {
        // Retrieve the list of posts for code.blogger.com
        var request = gapi.client.blogger.posts.list({
            'blogId': 'xxxxxxxxxxxxxxxxxxx',
            'fields': 'items(content,title,updated,id)'
        });
        request.execute(function(response) {
            var blogger = document.getElementById("blogger");
            var anchor = 0;
            for (var i = 0; i < response.items.length; i++)
            {
                var bloggerDiv = document.createElement("div");
                bloggerDiv.id = "blogger-" + i;
                bloggerDiv.className = "bloggerItem";
                $(bloggerDiv).append("<h2>" + response.items[i].title + "</h2>");
                var date = response.items[i].updated;
                date = date.replace("T", " ");
                date = date.replace("+09:00", "");
                var printDate = new moment(date);
                $(bloggerDiv).append("<p><span class='byline'>" + printDate.format('dddd, MMMM Do YYYY, h:mm:ss a') + "</span></p>");
                $(bloggerDiv).append(response.items[i].content)
                bloggerAnchor = document.createElement("a");
                bloggerAnchor.name = "blogger-" + response.items[i].id;
                blogger.appendChild(bloggerAnchor);
                blogger.appendChild(bloggerDiv);
                anchor = anchor + 1;
            }
            // Determine which anchor the user selected...
            var hashVal = window.location.hash.substr(1);
// ...then scroll to that position:
            location.hash = "#" + hashVal;
        });
    });
}

Answer №1

fetchBodies now defaults to false instead of true. Therefore, you must include the parameter fetchBodies=true.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Handlers for adjustments not correctly updating values in introduced object

I am facing an issue with a table that displays data fetched from an API and a select dropdown. Whenever a checkbox is selected, the name key along with its value is added to an array object named selectedFields. checkbox = ({ name, isChecked }) => { ...

Discovering an HTML Element in a JavaScript Array with Specific Styling: A Step-by-Step Guide

I am in the process of developing a website that consists of different sections. The concept is simple - by clicking on a button located at the bottom of the page, it will reveal the corresponding div section. For styling purposes, I have initially hidden ...

Error: NgFor can only be used to bind to data structures that are iterable, such as Arrays. JSON arrays are

Encountering ERROR Error: Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables like Arrays. *ngFor="let spec of vehicleSpecs" Tried various solutions and searched extensi ...

Preventing the (click) function from being activated during dragging in Angular 10

My div contains an openlayers map setup as shown below: <div id="map" (click)="getInfo($event)" class="map"></div> Whenever I drag my mouse to move around the map, the getInfo function is triggered. Is there a way to make it trigger only when ...

Having trouble with the JsonLoader copied from Threejs.org?

I've been trying to make use of a JSONLoader from threejs.org, but I'm facing some issues. Three.js seems to be functioning properly because I can easily create a cube. However, when I attempt to load a js file through the JSONLoader, nothing hap ...

Creating a one-of-a-kind entry by adding a number in JavaScript

I am looking for a way to automatically add an incrementing number to filenames in my database if the filename already exists. For example, if I try to add a file with the name DOC and it is already present as DOC-1, then the new filename should be DOC-2. ...

Selecting a value from a populated dropdown and checking the corresponding checkbox in SQL Server

There are 8 checkboxes in this example: <table style="border-collapse: collapse; width: 100%;" border="1"> <tbody> <tr style="height: 21px;"> <td style="width: 25%; height: 21px;"><strong>Technology</strong& ...

What is the best method for extracting string values from a JavaScript object?

I am working with JavaScript objects that look like this: {["186,2017"]} My goal is to extract and display only the values: 186, 2017 Initially, I attempted to use JSON.stringify thinking it was a JSON: console.log(JSON.stringify(data)); However, thi ...

What is the process of caching images when they are loaded through a php script?

My PHP script acts as a random image generator by querying the database for user images and returning a random one. Below is the code snippet responsible for serving the randomly chosen image. header('Content-Transfer-Encoding: binary'); header( ...

The term "GAPI" has not been declared or defined within the Svelte

Encountering an issue while trying to incorporate the Youtube data API into my Svelte application. Upon loading the site, the error message displayed is: Uncaught ReferenceError: gapi is not defined Reviewing the relevant code reveals: <svelte:head> ...

Style the date using moment

All languages had a question like this except for JavaScript. I am trying to determine, based on the variable "day," whether it represents today, tomorrow, or any other day. ...

Display PDF in Forge Viewer using PDF Extension - warning generated by pdf.worker.js

Whenever we attempt to display a PDF file using our own API, the pdf.worker.js generates a warning message and the PDF always appears completely white. https://i.stack.imgur.com/IqGML.png All I can see is this (it's a wide PDF that renders fine in t ...

When using AngularJS, encountered an issue where a view was not updating with new data from a $http request

When making a request to the 500px API using $http for popular photos, the response object is successfully returned. However, I am facing difficulty in pushing the retrieved photo items to the view. Below is my current controller code: meanApp.controller ...

Would you like to learn how to extract data from a specific textbox using jQuery and save it to a variable when the textbox is in

Below is a textbox that I am working on: <input type="text" name="company" id="company" required /> I am trying to figure out how to use jQuery to capture the values inside the textbox whenever they are typed or selected. Despite my efforts, I hav ...

How to conceal duplicate items in Angular2

In my Angular 2/4 application, I am fetching data from a web API (JSON) and displaying it in a table. In AngularJS, I use the following code: <tbody ng-repeat="data in ProductData | filter:search | isAreaGroup:selectedArea"> <tr style="backgro ...

What is the best way to calculate the number of squares required to completely fill a browser window in real-time?

I am creating a unique design with colorful squares to cover the entire browser window (for example, 20px by 20px repeated both horizontally and vertically). Each square corresponds to one of 100 different colors, which links to a relevant blog post about ...

Executing a controller method in Grails using JavaScript

When working in a Grails view, I find myself needing to execute a JavaScript method to retrieve certain information. To achieve this, I have set up a submit action as shown below: <input type="submit" name="submit" class="submit action-button" value="G ...

How can JArray be manipulated if the index is subject to change?

I have a JSON file that may contain varying numbers of items in the JSON array. The current code I am using is as follows: var obj = JArray.Parse(File.ReadAllText(url)); dfd = (from a in obj where a["PriceItems"][0]["CityFromID"].Value&l ...

Iterating over an array and displaying elements on the webpage

Struggling to access an array and loop through it, but only able to print out one element instead of all. Need a hint on how to solve this issue. See my code below: let toppingsCount; const burger = document.createElement('div'); const toppingsD ...

What is the best way to transfer a property-handling function to a container?

One of the main classes in my codebase is the ParentComponent export class ParentComponent extends React.Component<IParentComponentProps, any> { constructor(props: IParentComponent Props) { super(props); this.state = { shouldResetFoc ...