Archive

Posts Tagged ‘OpenSource’

Invite your contacts with OpenInviter

2011/01/15 Leave a comment

Some days ago my boss ask me to give our users the option to invite their contacts to join to our website Citiservi. Googling around I finally found a great open source project called OpenInviter.

Now we can retrieve contacts from gmail, yahoo, hotmail, facebook, twitter… There are plugins for some email providers (61), CMS (27) and social networks (43). To be accurate currently there are 104 plugins ready to use. Seems to be good… and it’s good!


The requeriments are the next:
– PHP5
– curl or wget
– DOM extension


The installation is very quick, in five minutes openinviter is ready to start to be used.

require_once(“‘your_path/openinviter.php”);

$email = “email@gmail.com”;
$passord = “my_password”;

$open_inviter = new OpenInviter();
$open_inviter->startPlugin(“gmail”);

if (!$open_inviter->getInternalError() &&
     $open_inviter->login($email, $password) &&
     $arr_contact = $open_inviter->getMyContacts()) {

     $oi_session_id = $open_inventer->plugin->getSessionID();
     foreach($arr_contact as $key => value) echo “{$key} : {$value}\n”;
}



In some cases, facebook as example, you can use the internal messaging system to send the invitation to user instead of to send an email manually.

$arr_message = array(‘subject’ => ‘Invitation subject’, ‘body’ => ‘Invitation body’);
$open_inviter->sendMessage($oi_session_id, $arr_message, $arr_contact);



You can update plugins in two ways: the autoupdate feature or manually. And install a new plugin is so easy as copy the plugin file into the plugins directory.

Advertisements
Categories: Uncategorized Tags: , ,