File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 5
5
from .linkedin import LinkedInApplication , LinkedInAuthentication , PERMISSIONS
6
6
7
7
8
- def quick_api (api_key , secret_key ):
8
+ def quick_api (api_key , secret_key , port = 8000 ):
9
9
"""
10
10
This method helps you get access to linkedin api quickly when using it
11
11
from the interpreter.
@@ -22,11 +22,11 @@ def quick_api(api_key, secret_key):
22
22
PERMISSIONS .enums .values ())
23
23
app = LinkedInApplication (authentication = auth )
24
24
print auth .authorization_url
25
- _wait_for_user_to_enter_browser (app )
25
+ _wait_for_user_to_enter_browser (app , port )
26
26
return app
27
27
28
28
29
- def _wait_for_user_to_enter_browser (app ):
29
+ def _wait_for_user_to_enter_browser (app , port ):
30
30
class MyHandler (BaseHTTPServer .BaseHTTPRequestHandler ):
31
31
def do_GET (self ):
32
32
p = self .path .split ('?' )
@@ -35,6 +35,6 @@ def do_GET(self):
35
35
app .authentication .authorization_code = params ['code' ][0 ]
36
36
app .authentication .get_access_token ()
37
37
38
- server_address = ('' , 8000 )
38
+ server_address = ('' , port )
39
39
httpd = BaseHTTPServer .HTTPServer (server_address , MyHandler )
40
40
httpd .handle_request ()
You can’t perform that action at this time.
0 commit comments