In [ ]:
from linkedin import linkedin
API_KEY = '7752sw6qx2r361'
API_SECRET = 'ZTZjN4WV3sImjf9B'
RETURN_URL = 'http://localhost:8000'
authentication = linkedin.LinkedInAuthentication(API_KEY, API_SECRET, RETURN_URL, ['r_basicprofile'])
print authentication.authorization_url
application = linkedin.LinkedInApplication(authentication)
In [ ]:
authentication.authorization_code = 'AQQwjOHWwomDUTY03kERi8sZdksVShRgdGdmXM1A4RdD1ybuOu5r6gD0kIKiQMpu_LJdXeN7vGa_vfBMMaELm4BsycT7_zXRUSYReZ1oKG4PXTd5SV0'
authentication.get_access_token()
In [ ]:
application = linkedin.LinkedInApplication(token='AQXLTH98yNxEBa3ud0UQeIzD2uPFquwyVKx6ReCY0J6zF2QYHEJgQamg9bQrevamUlfPx-Wv6pCnRUbUJ4rN-InsX6HlqdaTnX-Ppx6qLZvoe4_qM1Pt1sKKMvTPG8tAO4qv8CThqCTl3XZZ-TrdFsTkXvd7w7x3nLHreUoTgPMGXFOSexY')
application.get_profile()
In [ ]:
import json
connections = application.get_profile(selectors=['id', 'first-name', 'last-name', 'location', 'distance', 'num-connections', 'skills', 'educations'])
connections_data = '../data/profile.json'
f = open(connections_data, 'w')
f.write(json.dumps(connections, indent=1))
f.close()