File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 55from  .linkedin  import  LinkedInApplication , LinkedInAuthentication , PERMISSIONS 
66
77
8- def  quick_api (api_key , secret_key ):
8+ def  quick_api (api_key , secret_key ,  port = 8000 ):
99    """ 
1010    This method helps you get access to linkedin api quickly when using it 
1111    from the interpreter. 
@@ -22,11 +22,11 @@ def quick_api(api_key, secret_key):
2222                                  PERMISSIONS .enums .values ())
2323    app  =  LinkedInApplication (authentication = auth )
2424    print  auth .authorization_url 
25-     _wait_for_user_to_enter_browser (app )
25+     _wait_for_user_to_enter_browser (app ,  port )
2626    return  app 
2727
2828
29- def  _wait_for_user_to_enter_browser (app ):
29+ def  _wait_for_user_to_enter_browser (app ,  port ):
3030    class  MyHandler (BaseHTTPServer .BaseHTTPRequestHandler ):
3131        def  do_GET (self ):
3232            p  =  self .path .split ('?' )
@@ -35,6 +35,6 @@ def do_GET(self):
3535                app .authentication .authorization_code  =  params ['code' ][0 ]
3636                app .authentication .get_access_token ()
3737
38-     server_address  =  ('' , 8000 )
38+     server_address  =  ('' , port )
3939    httpd  =  BaseHTTPServer .HTTPServer (server_address , MyHandler )
4040    httpd .handle_request ()
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments