Hi Jason,
Thanks for the reply. And sorry "standalone application" may not
be the right term,as we need an application that runs on our website,
Something like the following code snippet which fetches details from
twitter.com (Using Socialgraph API). I need to know if a similar HTML
snippet is possible in orkut with opensocial API.
Code Snippet:
---------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equive="content-type" content="text/html; charset=utf-8" />
<title>Test Twitter Social Graph APP</title>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<style type="text/css">
<!--
body * {
font-size: 12px;
}
#box {
list-style: none;
}
#box li {
float: left;
width: 75px;
height: 40px;
margin: 1px 1px 1px 1px;
}
#box li div.username {
width: 75px;
height: 20px;
}
#footer {
clear: both;
}
-->
</style>
<script type="text/javascript">
<!--
var URL = '';
var FOLLOW = true;
var ME = '';
function lookUp(q)
{
if (q == '')
{
return;
}
URL = (q.match(/,/)) ? q : 'http://twitter.com/' + q;
var script = createEl('script', { src: ['http://
socialgraph.apis.google.com/lookup?callback=loop','q=' +
URL,'edo=1'].join('&'),type: 'text/javascript'});
var head = document.getElementsByTagName('head');
head[0].appendChild(script);
}
function loop(res)
{
for (var node in res.nodes)
{
if (!node.match(/^http:\/\/twitter\.com\//))
{
continue;
}
analyze(node, res.nodes[node]['nodes_referenced']);
}
}
var EACHOTHER = {};
function analyze(user, referenced)
{
var contacts = []
var box = document.getElementById('box');
for (var node in referenced)
{
if (node == 'http://twitter.com/friends')
{
continue;
}
if (node == 'http://twitter.com/' + ME)
{
EACHOTHER[user] = true;
}
if (referenced[node]['types'] == 'me')
{
var li = createEl('li', {id: user});
// username
var div = createEl('div', {className: 'username'});
var userName = document.createTextNode(user.replace(/^http:
\/\/twitter\.com\//, ''));
var ta = createEl('a', { href: user, target: '_blank'});
ta.appendChild(userName);
div.appendChild(ta);
li.appendChild(div);
box.appendChild(li);
}
else {
if (FOLLOW)
{
contacts.push(node);
} } }
FOLLOW = false;
if (contacts.length > 0)
{
offset = 0;
while (offset <= contacts.length)
{
lookUp(contacts.slice(offset, offset + 10).join(','));
offset += 10;
} }}
function createEl(name, attrs)
{
var el = document.createElement(name);
for (var key in attrs)
{
el[key] = attrs[key];
}
return el;
}
function reset() {
document.getElementById('box').innerHTML = '';
FOLLOW = true;
}
//-->
</script>
</head>
<body>
<p>Twitter User Name: <input type="text" name="q" id="q" value="hina">
<input type="button" id="go" value="GO!"
onclick="reset();ME=document.getElementById('q').value;lookUp(ME)" />
<ul id="box"></ul>
<p style="clear:both;">Test App working fine with twitter</p>
<div id="twitter"></div>
<div id="footer">
</div>
</body>
</html>
Jason wrote:
> What do you mean by "standalone"? And no, you cannot use the orkut ID
> at this time -- an OpenSocial ID is required which is different.
>
> - Jason
>
> On Sep 18, 9:57�pm, Madhan <[EMAIL PROTECTED]> wrote:
> > Is it possible to fetch a user profile and friend's list with the
> > orkut UID as input, to run as standalone application?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Orkut Developer Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/opensocial-orkut?hl=en
-~----------~----~----~----~------~----~------~--~---