Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,13 @@ import bs4
|
|
5 |
import lxml
|
6 |
import json
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
def find_rss(rss_url):
|
9 |
json_box=[]
|
10 |
json_dict={}
|
@@ -42,7 +49,9 @@ with gr.Blocks() as app:
|
|
42 |
with gr.Row():
|
43 |
rss = gr.Textbox(label="rss")
|
44 |
btn = gr.Button("load rss")
|
|
|
45 |
out_json = gr.JSON()
|
|
|
46 |
search_btn.click(find_rss,rss_search,out_json)
|
47 |
btn.click(get_rss,rss,out_json)
|
48 |
app.launch()
|
|
|
5 |
import lxml
|
6 |
import json
|
7 |
|
8 |
+
|
9 |
+
|
10 |
+
def read_rss():
|
11 |
+
f = open('feeds.json')
|
12 |
+
data = json.load(f)
|
13 |
+
return data
|
14 |
+
|
15 |
def find_rss(rss_url):
|
16 |
json_box=[]
|
17 |
json_dict={}
|
|
|
49 |
with gr.Row():
|
50 |
rss = gr.Textbox(label="rss")
|
51 |
btn = gr.Button("load rss")
|
52 |
+
r_btn=gr.Button("read")
|
53 |
out_json = gr.JSON()
|
54 |
+
r_btn.click(read_rss,None,out_json)
|
55 |
search_btn.click(find_rss,rss_search,out_json)
|
56 |
btn.click(get_rss,rss,out_json)
|
57 |
app.launch()
|