File size: 488 Bytes
01b7d84
 
3f1df0d
01b7d84
 
 
 
 
79272ae
 
 
617c1aa
79272ae
 
 
617c1aa
c47177e
01b7d84
617c1aa
01b7d84
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import gradio as gr
import requests
import xmltodict
import json




def get_rss(rss_url):
    
    r = requests.get(f'{rss_url}') 
    
    if ".json" in rss_url:
        lod = json.loads(r.text)
    if ".xml" in rss_url:
        #with open() as xml_file:
        data_dict = xmltodict.parse(r.text)
    return lod

with gr.Blocks() as app:
    with gr.Row():
        inp = gr.Textbox()
        btn = gr.Button()
    out_json = gr.JSON()
    btn.click(get_rss,inp,out_json)
app.launch()