-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser_data.py
More file actions
34 lines (32 loc) · 917 Bytes
/
user_data.py
File metadata and controls
34 lines (32 loc) · 917 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import requests
import os
# --- This file is used to post customer/user data to google sheets using SHEETY API --- #
print("Welcome to Arjunan's Flight Club")
print("We find the best flight deals and email you")
f_name = input("What is your First name?: ").title()
print(f_name)
l_name = input("What is your Last name?: ").title()
print(l_name)
email = input("What is your email?: ")
email1 = input("type your email again.")
SHEETY_USER_ENDPOINT = os.environ["sheety_user6"]
user_header = {
"Authorization": f'Bearer {os.environ["user_token"]}'
}
new_data = {
"user": {
"firstName": f_name,
"lastName": l_name,
"email": email
}
}
if email == email1:
response = requests.post(
url=SHEETY_USER_ENDPOINT,
json=new_data,
headers=user_header
)
print(response.text)
print("You're in the club...")
if email != email1:
print("Wrong email, type again")