Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install linkedin

How to install linkedin

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install linkedin
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.1.2
0.1.5Never BuiltWhy not?
0.1.2 Available View build log
0.1.1 Available View build log
0.1.0 Failed View build log
Windows (64-bit)
0.1.2
0.1.5Never BuiltWhy not?
0.1.2 Available View build log
0.1.1 Failed View build log
0.1.0 Failed View build log
Mac OS X (10.5+)
0.1.2
0.1.5Never BuiltWhy not?
0.1.2 Available View build log
0.1.1 Failed View build log
0.1.0 Failed View build log
Linux (32-bit)
0.1.5 Available View build log
0.1.2 Available View build log
0.1.1 Failed View build log
0.1.0 Failed View build log
Linux (64-bit)
0.1.5 Available View build log
0.1.2 Available View build log
0.1.1 Failed View build log
0.1.0 Failed View build log
 
Author
License
MIT License
Dependencies
Imports
Lastest release
version 0.1.5 on Mar 27th, 2013

#Overview Here's another library based on the LinkedIn API, OAuth and JSON responses.

Hope this documentation explains everything you need to get started. Any questions feel free to email me or inbox me.

#Install through pip... ` pip install linkedin `

If linkedin is already installed, pass -I to your install: ` pip install -I linkedin `

#Import LinkedIn library ` from linkedin import * `

#Authorization URL

Get an authorization url for your user

```python l = LinkedinAPI(api_key='your app key',

System Message: WARNING/2 (<string>, line 25); backlink

Inline literal start-string without end-string.

System Message: WARNING/2 (<string>, line 25); backlink

Inline interpreted text or phrase reference start-string without end-string.

System Message: ERROR/3 (<string>, line 27)

Unexpected indentation.
api_secret='your app secret', callback_url='http://www.example.com/callback/', permissions=["r_network"])

auth_props = l.get_authentication_tokens() auth_url = auth_props['auth_url']

#Store this token in a session or something for later use in the next step. oauth_token_secret = auth_props['oauth_token_secret']

print 'Connect with LinkedIn via: %s' % auth_url ``` If you leave callback_url blank, you can get the oauth_verifier from the web browser. It is a five-digit integer.

System Message: WARNING/2 (<string>, line 37); backlink

Inline literal start-string without end-string.

The permissions parameter is optional. It can be a list or string. The [list of permissions](https://developer.linkedin.com/documents/authentication) is in the LinkedIn API documentation.

Once you click "Allow" be sure that there is a URL set up to handle getting finalized tokens and possibly adding them to your database to use their information at a later date. nn'

#Handling the callback ```python # In Django, you'd do something like # oauth_token = request.GET.get('oauth_token') # oauth_verifier = request.GET.get('oauth_verifier')

System Message: WARNING/2 (<string>, line 45); backlink

Inline literal start-string without end-string.

System Message: WARNING/2 (<string>, line 45); backlink

Inline interpreted text or phrase reference start-string without end-string.

oauth_token = Grab oauth token from URL oauth_verifier = Grab oauth verifier from URL

#Initiate the LinkedIn class in your callback. l = LinkedinAPI(api_key='your app key',

System Message: ERROR/3 (<string>, line 56)

Unexpected indentation.
api_secret='your app secret', oauth_token=oauth_token, oauth_token_secret=session['linkedin_session_keys']['oauth_token_secret'])

authorized_tokens = l.get_access_token(oauth_verifier)

final_oauth_token = authorized_tokens['oauth_token'] final_oauth_token_secret = authorized_tokens['oauth_token_secret']

# Save those tokens to the database for a later use? ```

System Message: WARNING/2 (<string>, line 65); backlink

Inline literal start-string without end-string.

System Message: WARNING/2 (<string>, line 65); backlink

Inline interpreted text or phrase reference start-string without end-string.

#Getting some user information, search results, network updates. ```python # Get the final tokens from the database or wherever you have them stored

System Message: WARNING/2 (<string>, line 68); backlink

Inline literal start-string without end-string.

System Message: WARNING/2 (<string>, line 68); backlink

Inline interpreted text or phrase reference start-string without end-string.
l = LinkedinAPI(api_key = 'your app key',
api_secret = 'your app secret', oauth_token=final_tokens['oauth_token'], oauth_token_secret=final_tokens['oauth_token_secret'])

# Get your profile information (first name, last name) profile = l.get('people/~', fields='first-name,last-name') print profile

# Get search results search = l.get('people-search', params={'keywords':'Hacker'}) print search

# Get your network updates feed = l.get('people/~/network/updates') print feed ```

System Message: WARNING/2 (<string>, line 85); backlink

Inline literal start-string without end-string.

System Message: WARNING/2 (<string>, line 85); backlink

Inline interpreted text or phrase reference start-string without end-string.

# POST a network update ```python share_content = {

System Message: WARNING/2 (<string>, line 90); backlink

Inline literal start-string without end-string.

System Message: WARNING/2 (<string>, line 90); backlink

Inline interpreted text or phrase reference start-string without end-string.

System Message: ERROR/3 (<string>, line 93)

Unexpected indentation.

"comment": "Posting from the API using JSON", "content": {

System Message: ERROR/3 (<string>, line 95)

Unexpected indentation.
"title": "A title for your share", "submitted-url": "http://www.linkedin.com", "submitted-image-url": "http://lnkd.in/Vjc5ec"

System Message: WARNING/2 (<string>, line 98)

Block quote ends without a blank line; unexpected unindent.

}, "visibility": {

System Message: ERROR/3 (<string>, line 100)

Unexpected indentation.
"code": "anyone"

System Message: WARNING/2 (<string>, line 101)

Block quote ends without a blank line; unexpected unindent.

}

System Message: WARNING/2 (<string>, line 102)

Block quote ends without a blank line; unexpected unindent.

}

share_update = l.post('people/~/shares', params=share_content) print share_update ```

System Message: WARNING/2 (<string>, line 104); backlink

Inline literal start-string without end-string.

System Message: WARNING/2 (<string>, line 104); backlink

Inline interpreted text or phrase reference start-string without end-string.

Subscribe to package updates

Last updated Mar 27th, 2013

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.