1515__all__ = ['LinkedInAuthentication' , 'LinkedInApplication' , 'PERMISSIONS' ]
1616
1717PERMISSIONS = enum ('Permission' ,
18- COMPANY_ADMIN = 'rw_company_admin' ,
19- BASIC_PROFILE = 'r_basicprofile' ,
20- FULL_PROFILE = 'r_fullprofile' ,
21- EMAIL_ADDRESS = 'r_emailaddress' ,
22- NETWORK = 'r_network' ,
23- CONTACT_INFO = 'r_contactinfo' ,
24- NETWORK_UPDATES = 'rw_nus' ,
25- GROUPS = 'rw_groups' ,
26- MESSAGES = 'w_messages' )
27-
18+ COMPANY_ADMIN = 'rw_company_admin' ,
19+ BASIC_PROFILE = 'r_basicprofile' ,
20+ FULL_PROFILE = 'r_fullprofile' ,
21+ EMAIL_ADDRESS = 'r_emailaddress' ,
22+ NETWORK = 'r_network' ,
23+ CONTACT_INFO = 'r_contactinfo' ,
24+ NETWORK_UPDATES = 'rw_nus' ,
25+ GROUPS = 'rw_groups' ,
26+ MESSAGES = 'w_messages' )
2827
2928ENDPOINTS = enum ('LinkedInURL' ,
30- PEOPLE = 'https://api.linkedin.com/v1/people' ,
31- PEOPLE_SEARCH = 'https://api.linkedin.com/v1/people-search' ,
32- GROUPS = 'https://api.linkedin.com/v1/groups' ,
33- POSTS = 'https://api.linkedin.com/v1/posts' ,
34- COMPANIES = 'https://api.linkedin.com/v1/companies' ,
35- COMPANY_SEARCH = 'https://api.linkedin.com/v1/company-search' ,
36- JOBS = 'https://api.linkedin.com/v1/jobs' ,
37- JOB_SEARCH = 'https://api.linkedin.com/v1/job-search' )
38-
29+ PEOPLE = 'https://api.linkedin.com/v1/people' ,
30+ PEOPLE_SEARCH = 'https://api.linkedin.com/v1/people-search' ,
31+ GROUPS = 'https://api.linkedin.com/v1/groups' ,
32+ POSTS = 'https://api.linkedin.com/v1/posts' ,
33+ COMPANIES = 'https://api.linkedin.com/v1/companies' ,
34+ COMPANY_SEARCH = 'https://api.linkedin.com/v1/company-search' ,
35+ JOBS = 'https://api.linkedin.com/v1/jobs' ,
36+ JOB_SEARCH = 'https://api.linkedin.com/v1/job-search' )
3937
4038NETWORK_UPDATES = enum ('NetworkUpdate' ,
41- APPLICATION = 'APPS' ,
42- COMPANY = 'CMPY' ,
43- CONNECTION = 'CONN' ,
44- JOB = 'JOBS' ,
45- GROUP = 'JGRP' ,
46- PICTURE = 'PICT' ,
47- EXTENDED_PROFILE = 'PRFX' ,
48- CHANGED_PROFILE = 'PRFU' ,
49- SHARED = 'SHAR' ,
50- VIRAL = 'VIRL' )
39+ APPLICATION = 'APPS' ,
40+ COMPANY = 'CMPY' ,
41+ CONNECTION = 'CONN' ,
42+ JOB = 'JOBS' ,
43+ GROUP = 'JGRP' ,
44+ PICTURE = 'PICT' ,
45+ EXTENDED_PROFILE = 'PRFX' ,
46+ CHANGED_PROFILE = 'PRFU' ,
47+ SHARED = 'SHAR' ,
48+ VIRAL = 'VIRL' )
5149
5250
5351class LinkedInDeveloperAuthentication (object ):
@@ -57,6 +55,7 @@ class LinkedInDeveloperAuthentication(object):
5755 Useful for situations in which users would like to access their own data or
5856 during the development process.
5957 """
58+
6059 def __init__ (self , consumer_key , consumer_secret , user_token , user_secret ,
6160 redirect_uri , permissions = []):
6261 self .consumer_key = consumer_key
@@ -197,9 +196,9 @@ def search_profile(self, selectors=None, params=None, headers=None):
197196 return response .json ()
198197
199198 def get_picture_urls (self , member_id = None , member_url = None ,
200- params = None , headers = None ):
199+ params = None , headers = None ):
201200 if member_id :
202- url = '%s/id=%s/picture-urls::(original)' % (ENDPOINTS .PEOPLE , str (member_id ))
201+ url = '%s/id=%s/picture-urls::(original)' % (ENDPOINTS .PEOPLE , str (member_id ))
203202 elif member_url :
204203 url = '%s/url=%s/picture-urls::(original)' % (ENDPOINTS .PEOPLE ,
205204 urllib .quote_plus (member_url ))
@@ -268,7 +267,7 @@ def get_posts(self, group_id, post_ids=None, selectors=None, params=None,
268267 def join_group (self , group_id ):
269268 url = '%s/~/group-memberships/%s' % (ENDPOINTS .PEOPLE , str (group_id ))
270269 response = self .make_request ('PUT' , url ,
271- data = json .dumps ({'membershipState' : {'code' : 'member' }}))
270+ data = json .dumps ({'membershipState' : {'code' : 'member' }}))
272271 raise_for_error (response )
273272 return True
274273
@@ -431,7 +430,7 @@ def get_network_updates(self, types, member_id=None,
431430 self_scope = True , params = None , headers = None ):
432431 if member_id :
433432 url = '%s/id=%s/network/updates' % (ENDPOINTS .PEOPLE ,
434- str (member_id ))
433+ str (member_id ))
435434 else :
436435 url = '%s/~/network/updates' % ENDPOINTS .PEOPLE
437436
@@ -449,7 +448,7 @@ def get_network_updates(self, types, member_id=None,
449448 return response .json ()
450449
451450 def get_network_update (self , types , update_key ,
452- self_scope = True , params = None , headers = None ):
451+ self_scope = True , params = None , headers = None ):
453452 url = '%s/~/network/updates/key=%s' % (ENDPOINTS .PEOPLE , str (update_key ))
454453
455454 if not params :
0 commit comments