Installation
Step 1: Download / clone the following plugins:
- LinkedIn to plugins/linkedin
- HttpSocketOauth plugin (ProLoser fork) to plugins/http_socket_oauth
- Apis plugin to plugins/apis
database.php
Step 2: Setup your var $linkedin = array(
'datasource' => 'Apis.Apis',
'driver' => 'Linkedin.Linkedin',
'login' => '<linkedin api key>',
'password' => '<linkedin api secret>',
);
Step 3: Install the Apis-OAuth Component for authentication
MyController extends AppController {
var $components = array(
'Apis.Oauth' => 'linkedin',
);
function connect() {
$this->Oauth->connect();
}
function linkedin_callback() {
$this->Oauth->callback();
}
}
Step 4: Use the datasource normally
Check the wiki for available commands & usage
Class MyModel extends AppModel {
var $useDbConfig = 'linkedin';
function readProfile() {
$data = $this->find('all', array(
'path' => 'people/~',
'fields' => array(
'first-name', 'last-name', 'summary', 'specialties', 'associations', 'honors', 'interests', 'twitter-accounts',
'positions' => array('title', 'summary', 'start-date', 'end-date', 'is-current', 'company'),
'educations',
'certifications',
'skills' => array('id', 'skill', 'proficiency', 'years'),
'recommendations-received',
),
));
}
}