Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,16 +1,16 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import requests
|
| 3 |
|
| 4 |
-
|
| 5 |
def process_url(url):
|
| 6 |
try:
|
| 7 |
|
| 8 |
response = requests.get(url)
|
| 9 |
-
return response.status_code, response.text[:
|
| 10 |
except Exception as e:
|
| 11 |
return str(e)
|
| 12 |
|
| 13 |
-
|
| 14 |
iface = gr.Interface(fn=process_url,
|
| 15 |
inputs=gr.Textbox(label="Enter URL"),
|
| 16 |
outputs=["text", "text"],
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import requests
|
| 3 |
|
| 4 |
+
|
| 5 |
def process_url(url):
|
| 6 |
try:
|
| 7 |
|
| 8 |
response = requests.get(url)
|
| 9 |
+
return response.status_code, response.text[:1000]
|
| 10 |
except Exception as e:
|
| 11 |
return str(e)
|
| 12 |
|
| 13 |
+
|
| 14 |
iface = gr.Interface(fn=process_url,
|
| 15 |
inputs=gr.Textbox(label="Enter URL"),
|
| 16 |
outputs=["text", "text"],
|