ozgur / python-linkedin Goto Github PK
View Code? Open in Web Editor NEWPython interface to the LinkedIn API
Home Page: http://ozgur.github.com/python-linkedin/
License: MIT License
Python interface to the LinkedIn API
Home Page: http://ozgur.github.com/python-linkedin/
License: MIT License
When trying to get details on a list of companies I get the following error
temp = application.get_companies(company_ids=work_id, selectors=['company-type','industries','blog-rss-url','twitter-id','employee-count-range'])
Traceback (most recent call last):
File "", line 1, in
File "/Users/arvindvg/anaconda/lib/python2.7/site-packages/linkedin/linkedin.py", line 336, in get_companies
return response.json()
File "/Users/arvindvg/anaconda/lib/python2.7/site-packages/requests/models.py", line 763, in json
return json.loads(self.text, **kwargs)
File "/Users/arvindvg/anaconda/lib/python2.7/site-packages/simplejson/init.py", line 501, in loads
return _default_decoder.decode(s)
File "/Users/arvindvg/anaconda/lib/python2.7/site-packages/simplejson/decoder.py", line 370, in decode
obj, end = self.raw_decode(s)
File "/Users/arvindvg/anaconda/lib/python2.7/site-packages/simplejson/decoder.py", line 393, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
simplejson.scanner.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Is this is can issue with content thats empty that gets returned ? or something else
I've just 'discovered' your python-linkedin library earlier today and set it up and tried to make it work with Django.
But as soon as I set the authorization-code and want to retrieve the access-token with it, I get an LinkedInHTTPError : 401 Client Error: Unauthorized.
Here's my code; I'm using two views, one that redirects to the LinkedIn authorization page, and one for the return-url:
from django.shortcuts import render, render_to_response, redirect
from django.http import HttpResponse
from linkedin import linkedin
LI_API_KEY="123abc"
LI_API_SECRET="xyz123"
LI_RETURN_URL = 'http://127.0.0.1:8000/skills/linkedin-authcode/'
def signup(request):
# Instantiate the developer authentication class
authentication = linkedin.LinkedInAuthentication(LI_API_KEY, LI_API_KEY,
LI_RETURN_URL, linkedin.PERMISSIONS.enums.values())
return redirect( authentication.authorization_url )
def linkedin_authcode(request):
auth_code = request.GET.get('code', None)
state = request.GET.get('state', None)
authentication = linkedin.LinkedInAuthentication(LI_API_KEY, LI_API_KEY,
LI_RETURN_URL, linkedin.PERMISSIONS.enums.values())
authentication.authorization_code = auth_code
access_token = authentication.get_access_token()
print access_token
return HttpResponse("Linked Auth Code return page")
The debug-data I receive is:
Request Method: GET
Request URL: http://127.0.0.1:8000/skills/linkedin-authcode/?code=AQRandalotmore&state=4d64f8aa4b79a1fab3a73909a46bc322
Django Version: 1.6.2
Exception Type: LinkedInHTTPError
Exception Value:
401 Client Error: Unauthorized
Exception Location: /Library/Python/2.7/site-packages/linkedin/linkedin.py in get_access_token, line 123
Python Executable: /usr/bin/python
Python Version: 2.7.5
Python Path:
['/Users/planetcrypton/Sites/coworkerdev',
'/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages',
'/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload',
'/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC',
'/Library/Python/2.7/site-packages']
Server time: Wed, 7 May 2014 12:54:23 +0000
Hi @ozgur
I know this issue has been addresses previously in some other issue id. But I somehow am not able to make this work.
I am working on a virtualenvwrapper which is having python 3.4.2
When I run the http_api.py; I get the following output:
Traceback (most recent call last):
File "http_api.py", line 1, in
from linkedin import linkedin
File "/home/Saurabh/.virtualenvs/jobfinder/lib/python3.4/site-packages/linkedin/linkedin.py", line 294
except (requests.ConnectionError, requests.HTTPError), error:
^
SyntaxError: invalid syntax
Please fix this issue as soon as possible, in need urgently.
Thanks
I'm not managing to get the results from a profile using it's URL.
Basically I'm trying to use that request:
application.get_profile(member_url='http://www.linkedin.com/profile/view?id=238343623&authType=name&authToken=LMsx&trk=api*a3334503*s3406633*')
I also tried to use only:
application.get_profile(member_url='http://www.linkedin.com/profile/view?id=238343623')
Didn't work either, same error
Everything is working, I get a response using no parameters or the 'user id' as parameter, but I need to use the 'user public URL' to my searches.
Best Regards
Michel
First of all, thanks for sharing the library. It was great connecting with LinkedIn.
I have one issue with connection object.
conns = application.get_connections(
selectors=['id','first-name', 'last-name','headline','industry'],
params={ 'modified':'updated','modified-since': epoch }
)
It seems that modified-since parameter is ignored. No matter what date timestamp I passed as parameters, it always return all connections.
Did I missing something ? Thanks in advance.
I recently saw this https://developer.linkedin.com/support/developer-program-transition. Are you guys aware of this? Will you update the API's to handle the changes? Or should I do something on my end? Please let me know your plan on this.
Linkedin's developer documentation states that the URl should have the following structure when making a request for the access
https://www.linkedin.com/uas/oauth2/accessToken?grant_type=authorization_code
&code=AUTHORIZATION_CODE
&redirect_uri=YOUR_REDIRECT_URI
&client_id=YOUR_API_KEY
&client_secret=YOUR_SECRET_KEY
Therefore, should the get_access_token() not be rewritten as:
def get_access_token(self, timeout=60):
assert self.authorization_code, 'You must first get the authorization code'
qd = {'grant_type': 'authorization_code',
'code': self.authorization_code,
'redirect_uri': self.redirect_uri,
'client_id': self.key,
'client_secret': self.secret}
qsl = ['%s=%s' % (urllib.quote(k), urllib.quote(v)) for k, v in qd.items()]
fullURL = '%s?%s' % (self.ACCESS_TOKEN_URL, '&'.join(qsl))
response = requests.post(fullURL, timeout=timeout)
raise_for_error(response)
response = response.json()
self.token = AccessToken(response['access_token'], response['expires_in'])
return self.token
is it possible to refresh the access token via the available class methods? like this (but for oauth2):
https://developer.linkedin.com/blog/tips-and-tricks-refreshing-access-token
looking at the source code, this did not appear to be supported...
this feature would be helpful, as after manually jumping through the hoops (as described in your docs) to retrieve the first access token, my app can automatically grab a new access token every ~59 days...
thanks.
The last python-linkedin release is more than one year old. In the meantime, you got many fixes and Python 3 support. Can you please upload the 4.2 version to PyPI? Thanks!
Hi,
I have a problem when I want to access the fields of the posts within a group.
To be more specific, I can access the fields for the first 10 posts ( from 0 to 9 ). After the post 9, I get an error from the client: linkedin.exceptions.LinkedInError: 404 Client Error: Not Found: Unknown Error
Do you have any clue?
Thanks!
The library doesn't seem to import consistently when I'm using it within a virtualenv and python 2.6 (am about to try 2.7). I get the following error:
from linkedin import linkedin
Traceback (most recent call last):
File "", line 1, in
File "/Users/geoffwalmsley/Dropbox/WMA/WMA/lib/python2.6/site-packages/linkedin/linkedin.py", line 13, in
from .models import AccessToken, LinkedInInvitation
File "/path_to_virtualenv/lib/python2.6/site-packages/linkedin/models.py", line 4, in
verbose=False, rename=False)
TypeError: namedtuple() got an unexpected keyword argument 'rename'
Hi,
I was having trouble getting linkedin authentication process working and have been getting the following error:
<class 'requests.exceptions.ProxyError'> Cannot connect to proxy. Socket error: Tunnel connection failed: 403 Forbidden.
The error occurs when I try and call: authentication.get_access_token(). Code below.
I'm not sure if this is useful but I'm running the code via pythonanywhere.com using the web2py framework.
Any help would be great!
Thanks,
Viv
from linkedin import linkedin
import urlparse
def linkedin_setup():
# Define CONSUMER_KEY, CONSUMER_SECRET
CONSUMER_KEY = '______'
CONSUMER_SECRET = '___________'
# RETURN_URL from the credentials
RETURN_URL = "____________"
# Check current URL to see if if the URL has the 'code' variable from linkedin
current_url = URL(args=request.args, vars=request.get_vars, host=True)
parsed = urlparse.urlparse(current_url)
URL_dict = urlparse.parse_qs(parsed.query)
authentication = linkedin.LinkedInAuthentication(CONSUMER_KEY, CONSUMER_SECRET, RETURN_URL, linkedin.PERMISSIONS.enums.values())
# if code variable exists then get token
if 'code' in URL_dict:
authentication.authorization_code = urlparse.parse_qs(parsed.query)['code']
authentication.get_access_token()
else:
application = linkedin.LinkedInApplication(authentication)
redirect(authentication.authorization_url) # open this url on your browser
I am trying to retrieve email address of my connections using get_connections and get_profile methods. But it doesn't return the email address.
responseJson =application.get_connections(selectors=["id","first-name","last-name","email-address"])
When I call this, it returns only id, first-name and last-name of my connections.
As mentioned in http://developers.linkedin.com/documents/profile-fields#email, I have set r_emailaddress permission also.
Can anyone please help me to get it resolved ?
I need to do a search like this:
http://api.linkedin.com/v1/company-search:(facets)?keywords={keyword}&facets=location
using the search_company() method, but I don't know how can I structure it
Best Regards
Michel
Hi,
I'm trying to use your library however I'm getting error when I call get_access_token.
After getting authorization_code, I'm calling:
authentication = linkedin.LinkedInAuthentication(API_KEY, API_SECRET, RETURN_URL, linkedin.PERMISSIONS.enums.values())
authentication.authorization_code = '?????????'
authentication.get_access_token()
This throw an exception:
Traceback (most recent call last):
File "teste.py", line 12, in
authentication.get_access_token()
File "/usr/local/lib/python2.7/dist-packages/python_linkedin-2.0-py2.7.egg/linkedin/linkedin.py", line 96, in get_access_token
raise LinkedInHTTPError(error.message)
linkedin.exceptions.LinkedInHTTPError: 400 Client Error: Bad Request
Hi, I have to maintain legacy PHP code, which has a problem as described in this SO thread:
http://stackoverflow.com/questions/21811385/php-oauth-removes-the-location-from-the-received-headers
I would like to run the following script using the PHP exec command, after the user is already authenticated with LinkedIn using the PHP application but I get a 400 code.
Is there a way to debug this response:
PHP code:
$path = dirname(__FILE__) . '/group_share.py';
$cmd ="python {$path} {$token} {$secret} {$app_token} {$app_secret} {$groupId} {$jobPostBody} 2>&1";
$tmp = exec($cmd,$output);
print_r($output);
exit(1);
Python script
#@description python implementation for linkedin groups share
#@param argv[1] user token
#@param argv[2] user secret
#@param argv[3] app token
#@param argv[4] app secret
#@param argv[5] group id
#@param argv[6] post body
#@param argv[7] return url
import sys
from linkedin import linkedin
USER_TOKEN = sys. argv[1]
USER_SECRET = sys. argv[2]
CONSUMER_KEY = sys.argv[3]
CONSUMER_SECRET = sys.argv[4]
RETURN_URL = sys.argv[7] or None
REQUEST_BODY = sys.argv[6]
RESOURCE = 'http://api.linkedin.com/v1/groups/' + sys.argv[5] + '/posts'
auth = linkedin.LinkedInDeveloperAuthentication(CONSUMER_KEY, CONSUMER_SECRET, USER_TOKEN, USER_SECRET, RETURN_URL, linkedin.PERMISSIONS.enums.values())
app = linkedin.LinkedInApplication(auth)
post_response = app.make_request('POST', RESOURCE, REQUEST_BODY)
print post_response
Output is:
Array ( [0] => {'cookies': <[Cookie(version=0, name='lidc', value='"b=VB22:g=44:u=1:i=1392635829:t=1392722220:s=213364215"', port=None, port_specified=False, domain='.linkedin.com', domain_specified=True, domain_initial_dot=True, path='/', path_specified=True, secure=False, expires=1392722220, discard=False, comment=None, comment_url=None, rest={}, rfc2109=False)]>, '_content': '{\n "errorCode": 0,\n "message": "Couldn\'t parse Json body: Unexpected character (\'t\' (code 116)): was expecting double-quote to start field name\\n at [Source: java.io.StringReader@10487452; line: 1, column: 3]",\n "requestId": "TVUOCOQ8PD",\n "status": 400,\n "timestamp": 1392716020952\n}', 'headers': CaseInsensitiveDict({'x-li-pop': 'PROD-ELA4', 'content-encoding': 'gzip', 'transfer-encoding': 'chunked', 'set-cookie': 'lidc="b=VB22:g=44:u=1:i=1392635829:t=1392722220:s=213364215"; Expires=Tue, 18 Feb 2014 11:17:00 GMT; domain=.linkedin.com; Path=/', 'vary': '*', 'x-li-uuid': 'ONpKjNfrUxPQ45sf0CoAAA==', 'server': 'Apache-Coyote/1.1', 'x-li-fabric': 'prod-lva1', 'connection': 'keep-alive', 'date': 'Tue, 18 Feb 2014 09:33:40 GMT', 'x-li-request-id': 'TVUOCOQ8PD', 'x-li-format': 'json', 'content-type': 'application/json;charset=UTF-8'}), 'url': u'http://api.linkedin.com/v1/groups/4896198/posts', 'status_code': 400, '_content_consumed': True, 'encoding': 'UTF-8', 'request': , 'connection': , 'elapsed': datetime.timedelta(0, 0, 682628), 'raw': , 'reason': 'Bad Request', 'history': []} )
I noticed that this library hasn't been updated recently on pypi, when are you planning to release it?
I'm seeing intermittent issues resulting in getting 'Unable to verify access token' from get_profile() after authenticating.
I'm checking if request.session.has_key('linkedin_access_token'): before calling it and it works fine in most cases.
Is this a known issue or am I doing something incorrectly?
When the response is not 2.xx, we are not keeping track of what the server has sent as a response that actually gives information about the error. We somehow need a way to keep the last error in the application instance.
Linkedin allows a comment AND/OR content with the Share API. The way the client currently works the content variables are always present and LinkedIn validation requires values when they aren't needed. I was thinking of changing submit_share
to something like the following. If the change is something you are interested in I'll submit a pull request.
def submit_share(self, comment=None, title=None, description=None, submitted_url=None, submitted_image_url=None, visibility='anyone'):
post = {
'visibility': {
'code': visibility,
}
}
if comment is not None:
post['comment'] = comment
if submitted_url is not None:
post['content'] = {
'title': title,
'submitted-url': submitted_url,
'submitted-image-url': submitted_image_url,
'description': description,
}
...
I'm trying to make my Python/Flask web app authenticate using the python-linkedin API.
In the tutorial a redirection is assumed:
"When you grant access to the application, you will be redirected to the return url with the following query strings appended to your RETURN_URL:"
So, basically I'm running my server online and checking if the GET request to my return URL have query strings(code and state).
So if I just try to access the address - http://winterfell-django-1-90354.euw1.nitrousbox.com:4000/ - I will perform the authentication.
After that, I redirection to my return URL (http://winterfell-django-1-90354.euw1.nitrousbox.com:4000/) is expected, but it doesn't happen.
Here is my code:
from linkedin import linkedin
import json
import csv
from flask import Flask , jsonify, abort, make_response, request, url_for
API_KEY = '77wcgvnmv1jywx'
API_SECRET = 'PPIzXGAPX1eEAa55'
RETURN_URL = 'http://winterfell-django-1-90354.euw1.nitrousbox.com:4000/'
app = Flask(name)
@app.route('/', methods = ['GET'])
def get_authentication():
global code
global state
if ((request.args.get('code')) and (request.args.get('state'))):
code = request.args.get('code')
state = request.args.get('state')
else:
authentication = linkedin.LinkedInAuthentication(API_KEY, API_SECRET, RETURN_URL, linkedin.PERMISSIONS.enums.values())
application = linkedin.LinkedInApplication(authentication)
print authentication.authorization_url
print(code)
print(state)
return 'Code: ' + code + ' | State: ' + state
I'm only using GET verbs, don't know if that's the problem.
Maybe this is a dumb question but I'm totally new to apis and hope to get help.
I am following the instructions in the readme file and when I proceeded to
authentication.authorization_code = '???'
authentication.get_access_token()
I got this error:
linkedin.exceptions.LinkedInError: invalid_request: missing required parameters, includes an invalid parameter value, parameter more than once. : Unable to retrieve access token : appId or redirect uri does not match authorization code or authorization code expired
I'm using http://localhost:8000 as the return_url. I pasted the link the python printed and got the authorization_code and use it in the above code but got the error.
Someone help me out please...Really have no idea...
d = application.get_company_updates(1035, params={'count': 26})
print d['_count']
It only returns 10, not 26.
I have got authorization for Job Look Up API and Job Search API. The function for Job Search API works. But when I was trying to get information for a specific job, I used the following code and got the error below:
application.get_job(job_id=27576874)
raise LinkedInError(message)
linkedin.exceptions.LinkedInError: 400 Client Error: Bad Request: Unknown Error
Hope some one can help, thanks!
Hi I created this function for LinkedinApplication object similar to Javascript API's Member Updates, based on get_network_updates(). Hope you find it useful
def get_member_updates(self, types, linkedin_id, self_scope=True, params=None, headers=None):
url = '%s/%s/network/updates' % (ENDPOINTS.PEOPLE, linkedin_id)
if not params:
params = {}
if types:
params.update({'type': types})
if self_scope is True:
params.update({'scope': 'self'})
try:
response = self.make_request('GET', url, params=params, headers=headers)
response = response.json()
except requests.ConnectionError as error:
raise LinkedInHTTPError(error.message)
else:
if not self.request_succeeded(response):
raise LinkedInError(response)
return response
I am currently using the company search API and whatever "count" I specify I always get 20 resutls.
Is there a way to query the rest of them?
function get_job() does not apply provided selectors.
only need to add following lines after line 437:
if selectors:
url = '%s:(%s)' % (url, LinkedInSelector.parse(selectors))
Hi .. has developer authentication been removed by LinkedIn? I noticed today I had a number of failing calls with OAUTH errors and I went to check my developer keys and there is now no option to refresh them.
Has this been removed or is it now only available for partners?
If so might be good to add a note to the page documentation here or remove the developer authentication notes and endpoint.
Hi, it seems that there's a wrong line in make_request in LinkedInApplication.
The line: params = {} overwrites the method argument.
Traceback (most recent call last):
File "link-api.py", line 1, in <module>
from linkedin import linkedin
File "/home/leo_g/python-linkenin/venv/lib/python3.4/site-packages/linkedin/linkedin.py", line 294
except (requests.ConnectionError, requests.HTTPError), error:
I get the above error during installation and while trying to execute code.
I am using python3 on centos 7,
any help is apreciated
gives the following error on pip install .. and readme.rst is missing from the download on the pypi site.
Downloading/unpacking python-linkedin
Downloading python-linkedin-3.0.tar.gz
Running setup.py egg_info for package python-linkedin
Traceback (most recent call last):
File "", line 16, in
File "/djangoenv/build/python-linkedin/setup.py", line 12, in
with open(os.path.join(os.path.dirname(file), 'README.rst')) as readme:
IOError: [Errno 2] No such file or directory: '/djangoenv/build/python-linkedin/README.rst'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 16, in
File "/djangoenv/build/python-linkedin/setup.py", line 12, in
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
IOError: [Errno 2] No such file or directory: '/djangoenv/build/python-linkedin/README.rst'
Can you please leave older versions of the module on PyPI when you release new versions?
It breaks existing workflows when a module is in a pip requirements file against a specific tested version and then disappears. Here's a case in point [1]. I appreciate the work on additional versions, but it will take me some time to re-test and bump dependencies. Leaving the older versions available as an option would be a great service to people such as myself. Thank you for your consideration.
I have gone through python-linkedin api but havent figured out the way to make profile calls on behalf of the user , once the user authenticates the application
can anyone please suggest any solution
according to this
authentication = linkedin.LinkedInDeveloperAuthentication(CONSUMER_KEY, CONSUMER_SECRET,
USER_TOKEN, USER_SECRET,
RETURN_URL, linkedin.PERMISSIONS.enums.values())
I need more information
but here:
https://www.linkedin.com/developer/apps/
I can only get Client ID and Client Secret.
How and where do I find CONSUMER_KEY, CONSUMER_SECRET,
USER_TOKEN, USER_SECRET, ?
Thanks a lot
I am able to get almost to the end of the flow but I receive a: "ValueError: No JSON object could be decoded" based on the get_access_token() call.
The code:
class LinkedInLogin(webapp2.RequestHandler):
def get(self):
redirect_url ="http://127.0.0.1:14080/linkedincallback"
authentication = linkedin.LinkedInAuthentication(api_key, api_secret, redirect_url, ["r_basicprofile","r_emailaddress"])
self.redirect(authentication.authorization_url)
class LinkedInCallBack(webapp2.RequestHandler):
def get(self):
redirect_url ="http://127.0.0.1:14080/linkedincallback"
authentication = linkedin.LinkedInAuthentication(api_key, api_secret, redirect_url, ["r_basicprofile","r_emailaddress"])
authentication.authorization_code = self.request.GET["code"]
authentication.get_access_token()
Hello,
More and more when I have the question "which community is most active" when comparing open source efforts I am using Ohloh.net
To that end I noticed that this python-linkedin project is not yet on there and I'd like to add it to my personal list in order to give this project more visibility. Would you be up for adding this project there as the "owner"?
I am totally new to python. From issue 70 (syntax error), it appears that this package does not support python 3. Why not? Thanks.
Hello!
I'm getting
LinkedInError: Request Error: [unauthorized]. No consumer found for key
when trying to authorise. The token is valid as I am able to make API requests with http://developer.linkedinlabs.com/oauth-test/
auth = linkedin.LinkedInDeveloperAuthentication(CONSUMER_KEY, CONSUMER_SECRET,
USER_TOKEN, USER_SECRET,
RETURN_URL,
permissions=linkedin.PERMISSIONS.enums.values())
app = linkedin.LinkedInApplication(auth)
app.get_profile()
currently using your module in https://github.com/osheadavid7/py-resume. Very useful, thank you.
When trying to submit a post to a group, the following error is raised:
>>> application.submit_group_post(group_id, title, summary, submitted_url, submitted_image_url, content_title, description)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "linkedin/linkedin.py", line 363, in submit_group_post
response = response.json()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests/models.py", line 733, in json
return json.loads(self.text, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/simplejson/__init__.py", line 488, in loads
return _default_decoder.decode(s)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/simplejson/decoder.py", line 370, in decode
obj, end = self.raw_decode(s)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/simplejson/decoder.py", line 389, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
simplejson.scanner.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
because the response has an empty content that cannot be json decoded.
What is the expected content of a successful response?
When i execute the "http_api.py" i am getting the following error.The error is like this
$ python http_api.py
Server started on port: 8080
Exception happened during processing of request from ('127.0.0.1', 49805)
Traceback (most recent call last):
File "D:\Python27\Lib\SocketServer.py", line 593, in process_request_thread
self.finish_request(request, client_address)
File "D:\Python27\Lib\SocketServer.py", line 334, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "D:\Python27\Lib\SocketServer.py", line 649, in init
self.handle()
File "D:\Python27\Lib\BaseHTTPServer.py", line 340, in handle
self.handle_one_request()
File "D:\Python27\Lib\BaseHTTPServer.py", line 328, in handle_one_request
method()
File "http_api.py", line 57, in do_GET
print liw.authentication.authorization_url
File "c:\Users\BITON-G510\Desktop\XMPP_ENV\lib\site-packages\linkedin\linkedin.py", line 96, in authorization_url
qsl = ['%s=%s' % (urllib.quote(k), urllib.quote(v)) for k, v in qd.items()]
File "D:\Python27\Lib\urllib.py", line 1269, in quote
raise TypeError('None object cannot be quoted')
TypeError: None object cannot be quoted.
What is the mistake i am doing..?
When inspecting the company location info, it appears that some of the information that is available via the LinkedIn api is missing; here is some sample information returned:
{u'contactInfo':
{u'fax': u'+1 (888) 849 7339',
u'phone1': u'+1 (888) 849 7339'},
u'address': {
u'postalCode': u'95054',
u'city': u'Santa Clara',
u'street1': u'Mission City Center, Suite 925'
}
}
Additional information could be:
Hi,
Thank you for the great lib, works fine.
I am looking for an example on how to use facets in the people search api
application.search_profile(selectors=[{'people': ['first-name', 'last-name']}], params=p)
I have tried the following for p:
p={}
p['keywords'] = 'datamining'
p['countryCode'] = 'nl'
p['facet'] = 'location,nl:0'
p['company-name'] = 'netwerk%20vsp'
p['current-company'] = 'true'
p['sort'] = 'connections'
p['sort'] = 'recommenders'
p['facets'] = 'Industry,Network'
p['facet'] = 'industry,41' # no effect no error
p['facet'] = 'network,F' # no efect no error
Please publish the newest version of this library on PyPI so that the version on PyPI is compatible with the current documentation.
If you want to submit a share that is only a comment and an image then the submit fails with a keyerror.
In the function submit_company_share the following code exists:
if title is not None and submitted_url is not None:
post['content'] = {
'title': title,
'submitted-url': submitted_url,
'description': description,
}
if submitted_image_url:
post['content']['submitted-image-url'] = submitted_image_url
content is only created if there is a title and a url. In this case trying to add an image url will cause the keyerror on content.
Is this by design? Does linkedin not allow for only a comment and an image?
The documentation at https://developer.linkedin.com/docs/company-pages#company_share does not prohibit the ability to only include the image_url in the content.
Thanks.
Exception happened during processing of request from ('127.0.0.1', 56082)
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/socketserver.py", line 609, in process_request_thread
self.finish_request(request, client_address)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/socketserver.py", line 344, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/socketserver.py", line 665, in init
self.handle()
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/http/server.py", line 398, in handle
self.handle_one_request()
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/http/server.py", line 386, in handle_one_request
method()
File "http_api.py", line 62, in do_GET
open_new_tab(liw.authentication.authorization_url)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/python_linkedin-4.2-py3.4.egg/linkedin/linkedin.py", line 101, in authorization_url
qsl = ['%s=%s' % (quote(k), quote(v)) for k, v in qd.items()]
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/python_linkedin-4.2-py3.4.egg/linkedin/linkedin.py", line 101, in
qsl = ['%s=%s' % (quote(k), quote(v)) for k, v in qd.items()]
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/urllib/parse.py", line 694, in quote
return quote_from_bytes(string, safe)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/urllib/parse.py", line 719, in quote_from_bytes
raise TypeError("quote_from_bytes() expected bytes")
Wish your help
I am finding a peculiar thing when using this library that I think may reflect an important bug, and I'd like your thoughts on it.
When I follow the OAuth flow with the "API Key" and "API Secret" from an app I created a couple of years ago (what I will call app1) and plug them into the flow as what you describe in the README.md as "application key" and "application secret", everything works fine. An important detail here is that the length and form of my API Key/Secret values resemble the same ones you use in the README.md as well.
However, when I create a new app (what I will call app2), I see that I now have an "API Key" a "Secret Key" as well as an "OAuth User Token" and "OAuth User Secret". The length/form of these values do not resemble at all my API Key/Secret from app1 (nor do they resemble your values from the README.md.) Regardless of which combination of these values that I use, the OAuth flow always results in a 401 error.
I am curious if you might be testing this library with values from an app you created long ago as opposed to an app recently and, thus, experiencing the same troubles that I am? Intuition suggests that this is the case.
I would be very interested in hearing back from you on this if you could create a brand new app and test, and seeing an update to the README that clarifies the language a bit and includes updated sample app values that work as-is.
This is currently blocking me, and I'm not quite sure how to proceed without getting down into the guts of the linkedin.py file. Are you able to assist?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.