AJAX Feed API Authentication issue of Picasa Web Album

34 views
Skip to first unread message

Bo

unread,
Jul 28, 2008, 11:58:34 AM7/28/08
to Google AJAX API
Hi AJAX Feed API experts,
I have a issue about authentication, please help me.
What steps will reproduce the problem?
I want to implement a html to access picasa private photos.
I follow the authentication steps,
post
"accountType=HOSTED_OR_GOOGLE&Email=sun...@gmail.com&Passwd=6236642&s
ervice=lh2&source=album" to https://www.google.com/accounts/ClientLogin
to
get authentication. But I still can't see the private Gallery after
authenticate successfully.
Please reference the attached source code for detail. You can use a IE
or other browser to run it.
I have 9 public Galleries and 1 private Gallery in my picaso web
album, so
the count of entries count should be 10, I think it should be a
issue,
please help me analyze it, thanks.

What is the expected output? What do you see instead?
The AJAX Feed API should return the private and public Galleries
after
authenticate successfully.

What version of the product are you using? On what operating system?
I use AJAX Feed API 1.0 in windows 2000 operating system.


Please provide any additional information below.

Best Regards
Sun Bo


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/
TR/html4/strict.dtd">
<html>
<head>
<title>AJAX Feed API Authentication issue of Picasa Web Album</
title>
<script type="text/javascript" src="http://www.google.com/
jsapi"></script>
<script type="text/javascript">
google.load("feeds", "1");
var xmlHttp;
function debug(msg)
{
var status = document.getElementById("status");
status.setAttribute("style","color:black");
status.innerHTML = status.innerHTML+ "<br>"+ msg;
}

function createXMLHttpRequest()
{
if (window.ActiveXObject)
{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
else if (window.XMLHttpRequest)
{
xmlHttp = new XMLHttpRequest();
}
}
function Album_onLoad()
{
debug("feed load");
var feed = new google.feeds.Feed("http://
picasaweb.google.com/data/feed/api/user/sunbo01");
feed.setResultFormat(google.feeds.Feed.XML_FORMAT);
feed.setNumEntries(1000);
feed.load(function(result) {
if (!result.error)
{
debug("feed load sucess");
var entries =
google.feeds.getElementsByTagNameNS(result.xmlDocument, "http://
www.w3.org/2005/Atom", "entry");
debug("entries count=" + entries.length);
debug("I have 9 public Galleries and 1 private
Gallery in my picaso web album, so the count of entries count should
be 10, I think it should be a issue, please help me analyze it,
thanks.");
}
});
}
function handleLoginStateChange()
{
if(xmlHttp.readyState == 4)
{
if(xmlHttp.status == 200)
{
debug("login success");
Album_onLoad();
}
}
}
function login()
{
debug("start login");
createXMLHttpRequest();
xmlHttp.onreadystatechange = handleLoginStateChange;
var body =
"accountType=HOSTED_OR_GOOGLE&Email=sun...@gmail.com&Passwd=6236642&service=lh2&source=album";
xmlHttp.open("POST", "https://www.google.com/accounts/
ClientLogin", true);
xmlHttp.setRequestHeader("Content-Type","application/x-www-
form-urlencoded");
xmlHttp.send(body);
}
google.setOnLoadCallback(login);
</script>
</head>
<body">
<div id="status">
</div>
</body>
</html>
Reply all
Reply to author
Forward
0 new messages