Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,11 +3,17 @@ import requests
|
|
3 |
import json
|
4 |
main_directory = "https://services.swpc.noaa.gov/"
|
5 |
def run():
|
|
|
6 |
feed1 = requests.get(main_directory)
|
7 |
-
|
|
|
|
|
|
|
|
|
8 |
print("#############")
|
9 |
-
print(feed1.
|
10 |
-
|
11 |
with gr.Blocks() as app:
|
12 |
-
|
|
|
13 |
app.launch()
|
|
|
3 |
import json
|
4 |
main_directory = "https://services.swpc.noaa.gov/"
|
5 |
def run():
|
6 |
+
link_box=[]
|
7 |
feed1 = requests.get(main_directory)
|
8 |
+
lines = feed1.text.split("\n")
|
9 |
+
for line in lines:
|
10 |
+
if "href=" in line:
|
11 |
+
link_box.append(line.split("href=")[1].split(">")[0])
|
12 |
+
print(feed1.json.keys())
|
13 |
print("#############")
|
14 |
+
print(feed1.text)
|
15 |
+
return link_box
|
16 |
with gr.Blocks() as app:
|
17 |
+
links=gr.JSON()
|
18 |
+
app.load(run,None,links)
|
19 |
app.launch()
|