开发者

Importing Linkedin contacts to my site using PHP [closed]

开发者 https://www.devze.com 2023-01-29 07:33 出处:网络
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references,or expertise, but this question will likely solicit debate, a
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 9 years ago. 开发者_运维百科

How do I import LinkedIn contacts to my site using PHP? I'm interested in scripts or help documentation.


You can use Connections API of linkedin to get all connection of your linkedin profile.

For that you need to connect to API via oAuth in your php script. you need access token to call this API.So you can save the access token in your database once you get it.

I've used Zend-Framework in my application and I've import all connection of linkedin through following function.

/**
     * Fetching Linkedin Contacts
     */

    public function getAllContacts($user_id,$account_id=NULL)
    {       
        $access_token = $this->fetchAccessToken($user_id,$account_id);
        $this->linkedin->access_token = new OAuthConsumer($access_token['oauth_token'], $access_token['oauth_token_secret']);
        **$xml_response = $this->linkedin->getProfile("~/connections");**       
        $contacts= simplexml_load_string($xml_response);
        //Zend_Debug::dump($contacts); 
        return $contacts;                       
    }

Hope it helps.


If you want to bring your personal profile/connection data over, you could use the LinkedIn API, specifically the Profile and/or Connections API's.

Once you've authorized yourself against the API via OAuth, You could write a PHP cron script that connects to LinkedIn and pulls this data periodically. Note that typically the Platform Guidelines do not allow for storage of data retrieved from the APIs unless you have explicit user permission. In this case, you are the user so it should be permitted for you to store and use this data as you need, but keep in mind that displaying your connection data to other non-authorized and non-connected users (i.e. anything other than shared connections) is strictly against the guidelines, at least from my understanding.

UPDATE: LinkedIn appears to have updated their policies, such that most of the referenced documentation above (which was previously linked to the corresponding document) is now located within their partner program.


Use open invitor http://openinviter.com/.

0

精彩评论

暂无评论...
验证码 换一张
取 消