Google Groups

Re: [bloggerDev] Is it the correct to call blogger API on JSONP?


Brett Morgan May 2, 2012 7:07 PM
Posted in group: Blogger Developer Group
Hi Tat Ming Cheung,

You are using the GData feed, rendered in JSON. There is nothing illegal here, just an older rendering. I think the newer JSON format rendered off of googleapis.com/blogger/* is an easier to use. The GData feeds will be supported for the foreseeable future, but future additions will be made on the Blogger JSON API base, as it has newer client library support, and internal infrastructure support.

Is there something in the GData feed that you need that isn't in the Blogger JSON API?

brett

On Thu, May 3, 2012 at 3:52 AM, Tat Ming Cheung <mcp...@gmail.com> wrote:
I using jQuery Ajax to call ,
The feed url is "http://cheungtatming.blogspot.com/feeds/comments/default" and request as "json-in-script" (JSONP) format.
It works like a charm, however , i don't find any sample on Google Developer guide like that.
I see the Version 2 API, all of the API Url is start with : https://www.googleapis.com/blogger/v2/xxxxx ,

So the sample code below that i using is V1 or illegal method?

The Code :

            var BloggerFunctions = {

                getComments : function(feedURL) {
                    var paras = {
                        alt : 'json-in-script'
                    };

                    $.ajax({
                        url : feedURL,
                        type : 'GET',
                        dataType : "jsonp",
                        success : BloggerFunctions.onGotCommentData,
                        data : paras
                    });

                },

                //Parse the JSON comment data returned by the Google Blogger API
                onGotCommentData : function(data) {
               
                    for(var i = 0; i < entries.length; ++i) {
                            html += "SOME THING INSIDE THE entries array";
                    }

                    var dom = $(html);
                    $('#recent_comments').append(dom);
                }
            }

            $(document).ready(function() {
                var feedURL = "http://cheungtatming.blogspot.com/feeds/comments/default";
                BloggerFunctions.getComments(feedURL);

            });

--
You received this message because you are subscribed to the Google Groups "Blogger Developer Group" group.
To view this discussion on the web visit https://groups.google.com/d/msg/bloggerdev/-/bPjpmHCMd9AJ.
To post to this group, send email to blogg...@googlegroups.com.
To unsubscribe from this group, send email to bloggerdev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/bloggerdev?hl=en.



--

Brett Morgan

Developer Relations Engineer, Blogger