Google
Summer of Code Proposal: Enabling social awareness to Drupal sites by
Sandip Dev
Sypnosis: This project aims to build modules which will enable the user to build a social community within a website. This project is aimed at creating modules which will help to find out how many other users a user is linked to. It will also add social relations to a page using XFN of FOAF. Leveraging on these modules, it will be easy for anyone to create a social networking website using Drupal or to make their Drupal sites socially aware. The basic aims of this project are the following
Create a module to access/update/delete a user’s Google Contacts using Google Contacts API. Further this module will also expose an API through which other Drupal modules will be able to access a user’s Google Contacts data.
Create a module to add XFN or FOAF tags to a site which define the relation of the creator of that page with other links on it
Create a module to retrieve information about a user’s friends and friends of friends using the Google Contacts API module (above) and Google Social Graph API.
Detailed description:
The aim of this project is to create modules that would enable Drupal users to create socially aware websites. This project would make it easy for users to find people they know either though their Gmail contacts or through connection build all around the world wide web. For this, I plan to create three modules, which are detailed below:
Google Contacts Module:
This module will enable a Drupal site to retrieve, update a delete a
user’s contact information from within the site.
The module will use AuthSub Proxy authentication to
authenticate a user and retrieve contact details. Once
authenticated, the user would be redirected to the proper page
within the site.
Moreover, since its Google which takes care of
authenticating the user, the problem of security is solved too. To
further simplify matters and keep security to the maximum, the
module will request a one-time token instead of a session token.
One-time tokens can be used only once while session tokens can be
used infinitely. However, session tokens need to be stored which
can lead to malicious use of such a token. Hence I would prefer to
use a one-time token. So every time the user wants to let the
website access her Google contacts, she will have to authenticate
herself with Google.
Alternatively, the user (and not the
website) could be given the option of choosing a one-time token or a
session token. This way the user is responsible for her
actions.
Also all tokens requested will be secured, i.e digitally
signed with a time-stamp. The intention is to maintain the highest
possible amount of security. I would need some help from my mentor
in implementing digital signatures as I do not have much experience
with this. AuthSub proxy can request secure tokens only if the
website is register with Google as described in
http://code.google.com/apis/accounts/docs/RegistrationForWebAppsAuto.html
Also
this module will expose methods by which other User Authentication
and invitation modules (such as invite), developed for Drupal, can
access Google contacts information.
References:
Google Contacts API Developers Guide: http://code.google.com/apis/contacts/developers_guide_protocol.html
Module to add XFN/FOAF
information to a site: Both XFN and FOAF define the
relations between people in a site, however their approach are
different. While XFN annotates the links on page, FOAF uses a
central file to define all relations. If the amount of tagging that
needs to be done is less, XFN would be a better choice. However, if
there is a lot of content FOAF would be more suitable.
The
module would allow a user to define relations on every link to a
page. All of these would then be saved in either XFN or FOAF format.
The choice of format would be on the site admin.
This module
would require changes to the core and this is where I would need
some help from my mentor. This tagging would enable the page to be
indexed by Google Social Graph crawlers so that the relations can be
searched.
References:
XFN: www.gmpg.org/xfn/
FOAF:
www.foaf-project.org/
Social Graph module:
This module would enable a user to search Google Social Graph
database for friends. This module would find other users linked to
this user by going through the links present on the user’s
profile page or blog, the user may also provide a link herself.
Using these links, the module would query the Social Graph Database
for people linked to the user. This process can be further repeated
by making Social Graph queries on the publicly available pages of
the friends of a user, thereby finding not just friends, but friends
of friends. All the Social Graph feeds, which are received as JSON
feeds, will be parsed for user information. The information thus
gathered can then be passed on to other modules. Hence, this module
will also expose an API through which other modules can call
it.
References:
Google Social Graph API:
http://code.google.com/apis/socialgraph/docs/
JSON:
http://www.json.org
Benefits:
Will enable creation of social networking sites using Drupal. Users can find who all they are linked too, not just directly but through friends and friends of friends. Because Social Graph indexes MySpace, Orkut , Hi5 and various other social networking sites, the possibilities are tremendous.
By proving relationship information within a site, other sites can find relations within the Drupal site.
A user will be able to access, modify and delete her Gmail Contacts from within a Drupal site.
Design goals:
Must be secure. The Google Contacts module will handle sensitive information (a list of email addresses and names). So security is of paramount importance. Hence all tokens requested by this module will be secure, i.e digitally signed with time stamps.
Must not have any bugs. I will make the modules ready for deployment. To achieve this, the module must be developed well before the deadline and must undergo severe testing so that all bugs can be discovered and patched.
The modules must expose an API through which other modules can access its functions.
Roadmap:
Up to May 14th: Understand the working of Google Data API and Google Contacts API.This is taking into account that my college submissions and exams begin on April 21st and will continue up to May 8th (I have to improve my CGPA, or else…).
May 14th to May 20th: Implement Google Contacts module with no security, i.e all tokens requested will be unsecured and one time tokens. The received feeds will then be parsed for information.
May 21st to May 31st: Then the feature of secure feeds will be implemented. For this the domain must be registered with Google as described in http://code.google.com/apis/accounts/docs/RegistrationForWebAppsAuto.html .
June 1st to June 2nd: A function will be implemented which passes data received by this module to other modules.
June 3rd to June 7th: Code testing and bug fixing.Module released for testing by the community.
June 8th: A day off. Will party because I have finished one module.
June 9th: Get a hang of XFN and FOAF.
June 10th to June 30th: Will implement XFN tagging on pages. It will need some changes to the core, in which I will need help from my mentor.
July 1stth to July 10th: Implement FOAF. Again I will need help for implementing any changes to the core.
July 11th to July 13th: Code testing and bug fixing. Module released for testing by the community.
July 14th: A day off. Party again.
July 15th: Get a hang of Social Graph API.
July 16th to July 31st: Implement Social Graph API module. The JSON data received will be parsed for necessary information.
August 1st to August 5th: Will implement functions through which other modules can access this module. Also will enable the Google Contacts API module to invoke this module. This would enable a user to find information about friends and friends of friends by just their Gmail contacts.
August 6th to August 10th: Code testing and bug fixing. Code released to community.
August 12th: Yes. Another break
The rest of the days will act as buffer. As I will be attending Drupal Barcamp at Ahmedabad, I shall ask fellow Drupal developers and users to try out my modules and give inputs.
About myself:
I am a sophomore student of Computer Engineering at Sardar Vallabhai Patel National Institute of Technology (www.svnit.ac.in), Surat, India –one of the best engineering colleges in India. I am 21 year old and have been hooked to computers since the age of 10. I have been using GNU/Linux since my 8th standard. I made my school website when I was in my 9th standard. The website is now dead as there was no one to maintain it after me. The first time I got involved with FOSS was with dotGNU. Back in 2002, I had learned a bit of .Net and tried running a few simple .Net apps in dotGNU. To be honest, I am not much into web programming. I know PHP and AJAX but I am more into C, C++ and Java. I had once developed a computer shop inventory system for my friend’s shop in four days, including learning VB 6. After that I have not delved much into Windows programming. I know MySQL and MS SQL Server. These days I am learning Python and a bit of Symbian programming. I have also been working on GNU/Linux clustering using MPICH as a hobby.
I have also started a GNU/Linux Users Group at my college and I am also the secretary of the ACM Chapter here, and the next chairman. I conduct workshop regularly on topics like GNU/Linux, algorithms, basic Game AI, Python, testing vulnerability in websites etc. I am also a member of the robotics club of our college and a bit into 8051 and AVR programming and have participated in a few robotics events.
I am a fast learner and have been using PHP for nearly 18 months now. I have been using Drupal for nearly a year now. That is why, I believe I will be able to do this project fast and finish it well before the deadline and achieve all my design goals. I am looking forward to it.