/CakePHP-LinkedIn

LinkedIn API support for Cakephp.

Primary LanguagePHP

Installation

Step 1: Download / clone the following plugins:

Step 2: Setup your database.php

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',
			),
		));
	}
}