Spaces:
Runtime error
Runtime error
Commit
·
2d662f9
1
Parent(s):
69ca029
Update save_data.py
Browse files- save_data.py +3 -3
save_data.py
CHANGED
@@ -53,7 +53,7 @@ def get_location(ip_addr):
|
|
53 |
print("response======>>",response)
|
54 |
return response
|
55 |
|
56 |
-
def save_data_and_sendmail(paragraph, result_dic):
|
57 |
try:
|
58 |
print("welcome")
|
59 |
ip_address = ''
|
@@ -62,7 +62,7 @@ def save_data_and_sendmail(paragraph, result_dic):
|
|
62 |
print(ip_address)
|
63 |
location = get_location(ip_address)
|
64 |
print(location)
|
65 |
-
add_csv = [paragraph, result_dic, ip_address, location]
|
66 |
with open(DATA_FILE, "a") as f:
|
67 |
writer = csv.writer(f)
|
68 |
# write the data
|
@@ -71,7 +71,7 @@ def save_data_and_sendmail(paragraph, result_dic):
|
|
71 |
print("commit data :",commit_url)
|
72 |
|
73 |
url = 'https://pragnakalpdev33.pythonanywhere.com/HF_space_txt_sum'
|
74 |
-
myobj = {'para': paragraph,'result':result_dic,'ip_addr':ip_address,"location":location}
|
75 |
x = requests.post(url, json = myobj)
|
76 |
print("Email status: ",x.status_code)
|
77 |
|
|
|
53 |
print("response======>>",response)
|
54 |
return response
|
55 |
|
56 |
+
def save_data_and_sendmail(paragraph, sum_type, result_dic):
|
57 |
try:
|
58 |
print("welcome")
|
59 |
ip_address = ''
|
|
|
62 |
print(ip_address)
|
63 |
location = get_location(ip_address)
|
64 |
print(location)
|
65 |
+
add_csv = [paragraph, result_dic,sum_type, ip_address, location]
|
66 |
with open(DATA_FILE, "a") as f:
|
67 |
writer = csv.writer(f)
|
68 |
# write the data
|
|
|
71 |
print("commit data :",commit_url)
|
72 |
|
73 |
url = 'https://pragnakalpdev33.pythonanywhere.com/HF_space_txt_sum'
|
74 |
+
myobj = {'para': paragraph,'result':result_dic,'sum_type',sum_type,'ip_addr':ip_address,"location":location}
|
75 |
x = requests.post(url, json = myobj)
|
76 |
print("Email status: ",x.status_code)
|
77 |
|