How do I get my Gmail friends online status

I am developing one web application using (PHP JavaScript). I stuck to one point that I wanted to get my Gmail friend(s) online status.

e.g. I would provide one of my Gmail friend IDs i.e. abc@gmail.com as input to the API (if such an API is exist) and ultimately I wanted to track whether he is online or offline through normal script (PHP/JavaScript/jQuery/other).

Please folks provide me your necessary pointer(s) in this case. Does such API/library exist in PHP, Java script, jQuery or any other? How do I achieve this?

Answers


This is xmpphp, may be can help http://code.google.com/p/xmpphp/

Use this module with some code like:

<?php
include("xmpp.php");
$conn = new XMPP('talk.google.com', 5222, 'user', 'password', 'xmpphp', 'gmail.com', $printlog=True, $loglevel=LOGGING_INFO);
$conn->connect();
while(!$conn->disconnected) {
    $payloads = $conn->processUntil(array('presence'));
    foreach($payloads as $event) {
        $pl = $event[1];
        print "Presence: {$pl['from']} [{$pl['show']}] {$pl['status']}\n";
    }
}
?>

You could use Google app engine's XMPP service(automagically scales) for this(It has a generous free quota). There is also a java SDK but coding in python would be way shorter. The api has a get_presence(jid, from_jid=None) function which

Returns True if the user is online and available, False if the user is not online or away.

You could just hook it up to http(webhook) to create a simple api. If you watch the video Developing and deploying an application on Google App Engine, you will learn how to develop a simple app and to deploy it to google app engine.

I think you can create this XMPP api in about 25 minutes(10 minutes to watch the video) and have learned a little bit about the fun to use language python.


Need Your Help

Why won't my OpenGL draw anything?

c++ opengl sdl

I'm working on porting my open source particle engine test from SDL to SDL + OpenGL. I've managed to get it compiling, and running, but the screen stays black no matter what I do.

How to pass UDT as a parameter with ATL event

com atl

I'm trying to pass a UDT as a parameter to a ATL event.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.