Edouard,
Sorry for the delayed response, and great job with implementing the function. The friend stuff is actually on our task list, but down the list a bit. If you wouldn't mind sharing the code, we'd love to see what you've done and possibly adapt it for an upcoming release.
As for launching a script, it depends on exactly what you're looking for. You should likely create your own User Plugin to do what you're looking for. Within that plugin, you can add some code to different functions like "onBeforeStoreUser", which is triggered before a user updates their profile, or onLoginUser which is called when they login, etc. Alternatively, if it's a minor change, you could put the call directly in our JFBConnect User plugin, but that will get overridden whenever you install a new version.
To create your own plugin, there's a lot of great tutorials on how to do it. Basically, you should start with the Joomla Example plugin, installed with every Joomla installation. Modify the xml file for that extension to change the name and a few other settings and then install the updated xml and php files. Then, you can add the code to the functions already defined there as necessary. To check if the user is a Facebook user, you can use the following code:
jimport('joomla.filesystem.file');
$libraryFile = JPATH_ROOT.DS.'components'.DS.'com_jfbconnect'.DS.'libraries'.DS.'facebook.php';
if (!JFile::exists($libraryFile))
return true; # don't prevent logging in, but don't do anything Facebook related either
require_once ($libraryFile);
$jfbcLibrary = JFBConnectFacebookLibrary::getInstance();
$fbUserId = $jfbcLibrary->getUserId(FALSE);
if ($fbUserId)
{
// Do something
}
Hope this helps get you started. If you have more specific questions, don't hesitate to ask!