Google Groups

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


Brett Morgan May 9, 2012 6:15 PM
Posted in group: Blogger Developer Group
So, I am guessing you are asking for a method to be able to get latest comments, regardless of which post?

On Mon, May 7, 2012 at 11:28 PM, Tat Ming Cheung <mcp...@gmail.com> wrote:
Thanks you brett,

I don't use Blogger API 2.0 list in here (https://developers.google.com/blogger/docs/2.0/json/reference/comments/list)

Because i am working in a recent comment gadget for my blog.
I want to have recent 10 comments, but not only from specific post ID.

according from document , comments call have 2 method:

list
 - Retrieves the list of Comments for a Post. (base on specific one post ID)
get
 - Retrieves one Comments Resource by its commentId.  (base on specific one comment ID)

Brett Morgan於 2012年5月3日星期四UTC+8上午10時07分01秒寫道:
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

--
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/-/mnxAd6UjcWsJ.

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