Skip to content

Instantly share code, notes, and snippets.

View ramibch's full-sized avatar

Rami ramibch

View GitHub Profile
url_access_token = "https://www.linkedin.com/oauth/v2/accessToken"
auth_code = "YOUR_AUTH_CODE_FROM_PREVIOUS_VERIFICATION"
payload = {
'grant_type' : 'authorization_code',
'code' : auth_code,
'redirect_uri' : redirect_uri,
'client_id' : client_id,
'client_secret' : client_secret
}
# Get LinkedIn user ID
url = "https://api.linkedin.com/v2/me"
header = {
'Authorization' : f'Bearer {access_token}'
}
response = requests.get(url=url, headers=header)
response_json_li_person = response.json()
url = "https://api.linkedin.com/v2/shares"
headers = {
'Authorization' : f'Bearer {access_token}',
'Content-Type' : 'application/json'
}
payload = {
"content": {
"contentEntities": [
@ramibch
ramibch / setup_server.py
Created October 19, 2022 19:37 — forked from Senhaji-Rhazi-Hamza/setup_server.py
pyinfra deploy example
import os
from pyinfra import host
from pyinfra.operations import server, files
from pyinfra import local
ROOT_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
@ramibch
ramibch / GoogleDocsBackup.gs
Created October 18, 2022 17:02 — forked from brokensandals/GoogleDocsBackup.gs
Google Docs/Sheets/Slides automated backups script
var BACKUP_FOLDER_ID = 'INSERT_FOLDER_ID_HERE';
var NATIVE_MIME_TYPES = {};
NATIVE_MIME_TYPES[MimeType.GOOGLE_DOCS] = MimeType.MICROSOFT_WORD;
NATIVE_MIME_TYPES[MimeType.GOOGLE_SHEETS] = MimeType.MICROSOFT_EXCEL;
NATIVE_MIME_TYPES[MimeType.GOOGLE_SLIDES] = MimeType.MICROSOFT_POWERPOINT;
var NATIVE_EXTENSIONS = {};
NATIVE_EXTENSIONS[MimeType.GOOGLE_DOCS] = '.docx';
NATIVE_EXTENSIONS[MimeType.GOOGLE_SHEETS] = '.xlsx';
url = "https://api.linkedin.com/v2/shares"
headers = {
'Authorization' : f'Bearer {access_token}',
'Content-Type' : 'application/json'
}
payload = {
"content": {
"contentEntities": [
@ramibch
ramibch / README.md
Created December 12, 2021 15:57 — forked from mau21mau/README.md
Configure Celery + Supervisor With Django