Skip to content

Instantly share code, notes, and snippets.

View aveek22's full-sized avatar
🏠
Working from home

Aveek aveek22

🏠
Working from home
View GitHub Profile
url = "https://api.linkedin.com/v2/shares"
headers = {
'Authorization' : f'Bearer {access_token}',
'Content-Type' : 'application/json'
}
payload = {
"content": {
"contentEntities": [
# 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_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
}
base_url = "https://www.linkedin.com/oauth/v2/authorization"
redirect_uri = "https://thedatascholar.com/auth/linkedin/callback"
scope = "w_member_social,r_liteprofile"
url = f"{base_url}?response_type=code&client_id={client_id}&state=random&redirect_uri={redirect_uri}&scope={scope}"
print(url)
import requests # To deal with REST APIs
# Get the ClientID and ClientSecret to get the access token
client_id = "YOUR_CLIENT_ID"
client_secret = "YOUR_CLIENT_SECRET"
organization_id = "YOUR_ORGANIZATION_ID"
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
}
import requests
from config import Config
WORDPRESS_URL = 'https://public-api.wordpress.com/'
AUTH_TOKEN_URL = f'{WORDPRESS_URL}oauth2/token'
POSTS_URL = f'{WORDPRESS_URL}rest/v1.1/sites/{Config.SITE_ID}/posts/{Config.POST_ID}'
DROP TABLE IF EXISTS SQLShackGeomTest;
CREATE TABLE SQLShackGeomTest (
sensor_id VARCHAR(50) PRIMARY KEY NOT NULL,
longitude VARCHAR(50),
latitude VARCHAR(50),
country TEXT,
sensorTemp INTEGER,
sensorPressure INTEGER,
sensorTime TIMESTAMP,
EXEC master.dbo.sp_addlinkedserver
@server =N'AWS_ATHENA',
@srvproduct=N'',
@provider=N'MSDASQL',
@datasrc=N'AWS_ATHENA'
GO
EXEC master.dbo.sp_addlinkedsrvlogin
@rmtsrvname=N'AWS_ATHENA',
@useself=N'False',
CREATE TABLE Students(
student_number INT AUTO_INCREMENT PRIMARY KEY,
student_name VARCHAR(100),
dept_name VARCHAR(100),
subject VARCHAR(100),
marks INT
);
INSERT INTO Students (student_name,dept_name,subject,marks) VALUES
('Tom','CS','Programming',90),