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
resource "aws_s3_bucket" "main_bucket" {
bucket = "main-bucket-00721"
tags = {
"Name" = "Main Bucket"
"Environment" = "Test"
}
}
module "s3_main_bucket" {
source = "./modules/main-bucket"
}
module "s3_dependent_bucket" {
source = "./modules/dependent-bucket"
depends_on = [
module.s3_main_bucket
]
}
CREATE TABLE Laptops(
LaptopID INT IDENTITY(1,1) PRIMARY KEY,
LaptopName VARCHAR(100),
LaptopBrand VARCHAR(100),
ReleasedYear INT,
DeviceType VARCHAR(100),
Price DECIMAL(9,2)
)
GO
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": [
url = "https://api.linkedin.com/v2/shares"
headers = {
'Authorization' : f'Bearer {access_token}',
'Content-Type' : 'application/json'
}
payload = {
"content": {
"contentEntities": [
Parameters:
pDbName:
Type: String
pDbUser:
Type: String
pDbPass:
Type: String
Description: "It should be less than 8 characters"
Resources:
from flask import Flask
from flask_restful import Api, Resource, reqparse
import pandas as pd
app = Flask(__name__)
api = Api(app)
class Users(Resource):
def get(self):
data = pd.read_csv('users.csv')
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)