A Python Library to interface with LinkedIn API, OAuth and JSON responses

Overview

#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

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']

#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.

The permissions parameter is optional. It can be a list or string. The list of permissions 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'

#Handling the callback

# In Django, you'd do something like
# oauth_token = request.GET.get('oauth_token')
# oauth_verifier = request.GET.get('oauth_verifier')

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*',
              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?

#Getting some user information, search results, network updates.

# Get the final tokens from the database or wherever you have them stored

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

POST a network update

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
Owner
Mike Helmick
Mike Helmick
A telegram bot to forward messages automatically when they arrived.

Telegram Message Forwarder Bot A telegram bot, which can forward messages from channel, group or chat to another channel, group or chat automatically.

Adnan Ahmad 181 Jan 07, 2023
Monitoring plugin for MikroTik devices

check_routeros - Monitoring MikroTik devices This is a monitoring plugin for Icinga, Nagios and other compatible monitoring solutions to check MikroTi

DinoTools 6 Dec 24, 2022
Available slots checker for Spanish Passport

Bot that checks for available slots to make an appointment to issue the Spanish passport at the Uruguayan consulate page

1 Nov 30, 2021
Reads and prints information from the website MalAPI.io

MalAPIReader Reads and prints information from the website MalAPI.io optional arguments:

Squiblydoo 16 Nov 10, 2022
WebhookHub - A discord WebHook Manager with much more features coming soon

WebhookHub A discord WebHook Manager with much more features coming soon This is

5 Feb 19, 2022
A telegram bot to monitor the latest NFT price on BSC.

NFT_Monitor This is a telegram bot for monitoring price and ranking of NFT on Binance Smart Chain. Can fetch latest ranking and price in real time. .P

Niko Pang 10 Oct 09, 2022
Tracks twitter spaces and sends it to a discord webhook.

Tracks twitter spaces and sends it to a discord webhook. Uses the twitter api to find twitter spaces and then the m3u8 url for the space is found using selenium and will have it posted using a discor

Sam Phung 20 Dec 17, 2022
Revolt.py - An async library to interact with the https://revolt.chat api.

Revolt.py An async library to interact with the https://revolt.chat api. This library will be focused on making bots and i will not implement anything

Zomatree 0 Oct 08, 2022
A nuker for Roblox accounts.

Roblox-Nuker A nuker for Roblox accounts. Made by Ice Bear#0167 Usage I would recommend running in replit (https://replit.com) as it is deprecated in

7 May 10, 2022
A simple Discord bot wrote with Python. Kizmeow let you track your NFT project and display some useful information

Kizmeow-OpenSea-and-Etherscan-Discord-Bot 中文版 | English Ver A Discord bot wrote with Python. Kizmeow let you track your NFT project and display some u

Xeift 93 Dec 31, 2022
Embed the Duktape JS interpreter in Python

Introduction Pyduktape is a python wrapper around Duktape, an embeddable Javascript interpreter. On top of the interpreter wrapper, pyduktape offers e

Stefano 78 Dec 15, 2022
A python package to fetch results of various national examinations done in Tanzania.

Necta-API Get a formated data of examination results scrapped from necta results website. Note this is not an official NECTA API and is still in devel

vincent laizer 16 Dec 23, 2022
Whatsapp-bot - Whatsapp chatbot build with python and twilio

Whatsapp-bot This is a Whatsapp Chatbot that responds with quotes, reply owners

arinzejustinng 1 Jan 14, 2022
Implement backup and recovery with AWS Backup across your AWS Organizations using a CI/CD pipeline (AWS CodePipeline).

Backup and Recovery with AWS Backup This repository provides you with a management and deployment solution for implementing Backup and Recovery with A

AWS Samples 8 Nov 22, 2022
The WhatsApp lib

yowsup WARNING It seems that recently yowsup gets detected during registration resulting in an instant ban for your number right after registering wit

Tarek 6.8k Jan 04, 2023
Automation application was made by me using Google, Sheet and Slack APIs with Python.

README This application is used to transfer the data in the xlsx document we have to the Google Drive environment and calculate the "total budget" wit

3 Apr 12, 2022
A minimal caching proxy to GitHub's REST & GraphQL APIs

github-proxy A caching forward proxy to GitHub's REST and GraphQL APIs. GitHub-Proxy is a thin, highly extensible, highly configurable python framewor

Babylon Health 26 Oct 05, 2022
Bot for tenhou.net riichi mahjong server written in Python

[Tests coverage] Bot was tested with Python 3.7+ and PyPy3, we are not supporting Python 2. What do we have here? Mahjong hands calculation You can fi

190 Jan 06, 2023
Reddit comment bot emulating Telugu actor N. Bala Krishna.

Balayya-Bot Reddit comment bot emulating Telugu actor N. Bala Krishna. Project structure config.py contains Bot's higher level configuration. generate

Kari Lorince 2 Nov 05, 2021
Notion API Database Python Implementation

Python Notion Database Notion API Database Python Implementation created only by database from the official Notion API. Installing / Getting started p

minwook 78 Dec 19, 2022