CODE:
#!/usr/bin/python #-*-Coding:utf-8-*-"' Created on 2014-8-16@author:guaguastd@name:login.py ' ' # Twitter Logind EF Linkedin_login (): From LinkedIn import linkedin consumer_key = ' Consumer_secret = ' User_token = ' ' User_secret = ' return_url = ' #developer does not need this # instantiate the developer Authenticatio N class auth = LinkedIn. Linkedindeveloperauthentication (Consumer_key, Consumer_secret, User_token, User_secret, RETURN_URL, Permissions=linkedin. PERMISSIONS.enums.values ()) Linkedin_api = LinkedIn. Linkedinapplication (auth) return Linkedin_api
#!/usr/bin/python #-*-Coding:utf-8-*-"Created on 2014-8-16@author:guaguastd@name:user_profile_get.py" ' # import L Oginfrom Login Import linkedin_login# import jsonimport json# access to LinkedIn Apilinkedin_api = Linkedin_login () # Use a Pi to access User Profileprofiles = Linkedin_api.get_profile () # Print the Profilesprint json.dumps (profiles, indent=1)
RESULT:
{"headline": "Computer Networking Professional", "LastName": "Zhouping", "Sitestandardprofilerequest": { "url": "Http://www.linkedin.com/profile/view?id=324082475&authtype=name&authtoken=opyb&trk=api* A3620151*s3691851* "}, " FirstName ":" Beyond "}