Update app.py
Browse files
app.py
CHANGED
@@ -18,6 +18,7 @@ def get_api(inp,call,val,tot):
|
|
18 |
r = requests.get(f'{inp}?{call}={int(val)-i}')
|
19 |
new_data=r.text
|
20 |
new_dict = json.loads(new_data)
|
|
|
21 |
if "2024" in new_dict["data"]["member_since"]:
|
22 |
#print(new_dict)
|
23 |
out_box.append(new_dict)
|
@@ -36,7 +37,10 @@ with gr.Blocks() as app:
|
|
36 |
api_val=gr.Textbox(label="VALUE")
|
37 |
with gr.Column(scale=1):
|
38 |
val_tot=gr.Checkbox(label="Count", value=False)
|
39 |
-
|
|
|
|
|
40 |
outp=gr.JSON()
|
41 |
-
btn.click(get_api,[api_url,api_call,api_val,val_tot],outp)
|
|
|
42 |
app.launch()
|
|
|
18 |
r = requests.get(f'{inp}?{call}={int(val)-i}')
|
19 |
new_data=r.text
|
20 |
new_dict = json.loads(new_data)
|
21 |
+
print (new_dict)
|
22 |
if "2024" in new_dict["data"]["member_since"]:
|
23 |
#print(new_dict)
|
24 |
out_box.append(new_dict)
|
|
|
37 |
api_val=gr.Textbox(label="VALUE")
|
38 |
with gr.Column(scale=1):
|
39 |
val_tot=gr.Checkbox(label="Count", value=False)
|
40 |
+
with gr.Row():
|
41 |
+
btn=gr.Button("Search")
|
42 |
+
stop_btn=gr.Button("Stop")
|
43 |
outp=gr.JSON()
|
44 |
+
go_btn = btn.click(get_api,[api_url,api_call,api_val,val_tot],outp)
|
45 |
+
stop_btn.click(None,None,None,cancels=[go_btn])
|
46 |
app.launch()
|