Linkedin profile data importer for symfony
{
"require": {
"ccc/linkedin-importer-bundle": "dev-master"
...
}
}
public function registerBundles()
{
$bundles = array(
// ...
new CCC\LinkedinImporterBundle\CCCLinkedinImporterBundle(),
// ...
);
$ php composer.phar update
Add LinkedIn access details to your config:
ccc_linkedin_importer:
company: Company Name
app_name: Application Name
api_key: <api key>
secret_key: <secret key>
oauth_user_token: <oauth user token>
oauth_user_secret: <oauth user secret>
See /LinkedinImporterBundle/DefaultController.php for examples
$importer = $this->get('ccc_linkedin_importer.importer');
$profileToRetrieve = 'https://www.linkedin.com/in/Profile-ID/';
$callbackUrl = $this->generateUrl('callback', ['url' => $profileToRetrieve], UrlGeneratorInterface::ABSOLUTE_URL);
$importer->setRedirect($callbackUrl);
return $importer->requestPermission('basic');
$accessToken = $importer->requestAccessToken();
Private profile data
$profile_data = $importer->requestUserData('private', $access_token);
Public profile data
$profile_url = 'http://linkedin.com/someones-profile';
$profileData = $importer->requestUserData('public', $accessToken);