Search This Site

Custom Search

Thursday, May 20, 2010

[bloggerDev] Retrieving a comments feed seems to be not working from within an OAuth Gadget

Hello everyone!

I have implemented a Google Gadget featuring basic Blogger
functionality. For authentication, I am using the OAuth proxy, as
described here: http://code.google.com/apis/gdata/articles/gdata_gadgets.html#OAuthProxy

Retrieving the user's blogs as well as posts from these blogs works
quite fine. Also, creating, updating and deleting posts is working.
However, when I try to access a comments feed, the callback method
again and again receives a new OAuth approval URL. It seems as if --
when requesting the comments feed -- the Blogger API does not
recognize that the user is already logged in.

All I've done was changing from e.g.
_bloggerService.getBlogPostEntry(url, callback, errorHandler) to
_bloggerService.getBlogCommentFeed(url, callback, errorHandler). The
urls I'm passing to the function is correct, I've already checked
that.

Is this a bug or am I missing something obvious? Here is my code:

-----CODE START-----
function showComments(url)
{
var callback = function(response)
{
document.getElementById('comments').innerHTML = '';

if (response.oauthApprovalUrl)
{
var popup = shindig.oauth.popup(
{
destination: response.oauthApprovalUrl,
windowOptions: 'height=600,width=800',
onOpen: function() { displayDiv('authorized'); },
onClose: function() { showComments(url); }
});

(popup.createOpenerOnClick())();
}
else if (response.feed)
{
alert(gadgets.json.stringify(response.feed));
}
};

// produces an infinite loop cause the callback function recieves an
// oauthApprovalUrl again and again and again...
_bloggerService.getBlogCommentFeed(url, callback, function(error)
{alert(error);});
}
-----CODE END-----

Thanks a lot for your help!
--Max

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

No comments:

Post a Comment