Spaces:
Runtime error
Runtime error
Commit
·
4f14cb8
1
Parent(s):
2fab2f9
Update app.py
Browse files
app.py
CHANGED
|
@@ -108,23 +108,23 @@ def ccogsphere(name: str, rate: str, celsci: str):
|
|
| 108 |
celscix2="End"
|
| 109 |
cursor.execute("INSERT INTO reviews(name, view, duration,x) VALUES(?,?,?,?)", [nam, " wrote message: " , mess, celscix2])
|
| 110 |
db.commit()
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
reviews, total_reviews = get_latest_reviews(db)
|
| 129 |
db.close()
|
| 130 |
try:
|
|
|
|
| 108 |
celscix2="End"
|
| 109 |
cursor.execute("INSERT INTO reviews(name, view, duration,x) VALUES(?,?,?,?)", [nam, " wrote message: " , mess, celscix2])
|
| 110 |
db.commit()
|
| 111 |
+
else:
|
| 112 |
+
celsci2=celsci2[0] + "+" + celsci2[1]
|
| 113 |
+
celscix=celsci2[0] + celsci2[1]
|
| 114 |
+
celscix2=json.dumps(gcf(celscix))
|
| 115 |
+
#if celscix=={"message":"Cannot find information about Twitter Screen Name 'donald trump'"}:
|
| 116 |
+
# print ("no")
|
| 117 |
+
#else:
|
| 118 |
+
celsci2=ecf(celsci2)
|
| 119 |
+
df=pd.DataFrame.from_dict(celsci2["videos"])
|
| 120 |
+
celsci2=json.dumps(celsci2["videos"])
|
| 121 |
+
for index, row in df.iterrows():
|
| 122 |
+
view = str(row["views"])
|
| 123 |
+
duration = str(row["duration"])
|
| 124 |
+
print(view, duration)
|
| 125 |
+
#celsci=celsci+celsci2
|
| 126 |
+
cursor.execute("INSERT INTO reviews(name, view, duration,x) VALUES(?,?,?,?)", [celsci+str(index+1), view, duration, celscix2])
|
| 127 |
+
db.commit()
|
| 128 |
reviews, total_reviews = get_latest_reviews(db)
|
| 129 |
db.close()
|
| 130 |
try:
|