Personal tools
Skip to content. | Skip to navigation
from linkedin import * *Get an authorization url for your user* l = LinkedinAPI(api_key='*your app key*', 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'] 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. 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. \n\n' oauth_token = *Grab oauth token from URL* oauth_verifier = *Grab oauth verifier from URL* l = LinkedinAPI(api_key='*your app key*', 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'] 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']) profile = l.get('people/~', fields='first-name,last-name') print profile search = l.get('people-search', params={'keywords':'Hacker'}) print search feed = l.get('people/~/network/updates') print feed share_content = { "comment": "Posting from the API using JSON", "content": { "title": "A title for your share", "submitted-url": "http://www.linkedin.com", "submitted-image-url": "http://lnkd.in/Vjc5ec" }, "visibility": { "code": "anyone" } } share_update = l.post('people/~/shares', params=share_content) print share_update
llist is an extension module for CPython providing basic linked list data structures. Collections implemented in the llist module perform well in problems which rely on fast insertions and/or deletions of elements in the middle of a sequence. For this kind of workload, they can be significantly faster than collections.deque or standard Python lists. This extension requires CPython 2.5 or newer (3.x is supported). If you are looking for an implementation of linked lists in pure Python, visit http://github.com/rgsoda/pypy-llist/ The pypy-llist module has the same API as this extension, but is significantly slower in CPython. Currently llist provides the following types of linked lists: dllist - a doubly linked list sllist - a singly linked list
The lockfile module exports a FileLock class which provides a simple API for locking files. Unlike the Windows msvcrt.locking function, the Unix fcntl.flock, fcntl.lockf and the deprecated posixfile module, the API is identical across both Unix (including Linux and Mac) and Windows platforms. The lock mechanism relies on the atomic nature of the link (on Unix) and mkdir (on Windows) system calls.
The logutils package provides a set of handlers for the Python standard library's logging package. Some of these handlers are out-of-scope for the standard library, and so they are packaged here. Others are updated versions which have appeared in recent Python releases, but are usable with older versions of Python and so are packaged here.
lxml provides a Python binding to the libxslt and libxml2 libraries. It follows the ElementTree API as much as possible in order to provide a more Pythonic interface to libxml2 and libxslt than the default bindings. In particular, lxml deals with Python Unicode strings rather than encoded UTF-8 and handles memory management automatically, unlike the default bindings.