Omnibus commited on
Commit
5ebc5a8
1 Parent(s): 0a3e480

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -11,7 +11,7 @@ def find_rss(rss_url):
11
  r = requests.get(f'{rss_url}')
12
  soup = bs4.BeautifulSoup(r.content,'lxml')
13
  for i,p in enumerate(soup.find_all("a")):
14
- if ".xml" in p['href'] or ".json" in p['href']:
15
  print (p['href'])
16
  json_dict[p.text]=p['href']
17
  json_box.append(json_dict)
@@ -22,8 +22,9 @@ def get_rss(rss_url):
22
  if ".json" in rss_url:
23
  lod = json.loads(r.text)
24
  if ".xml" in rss_url:
25
- #with open() as xml_file:
26
  lod = xmltodict.parse(r.text)
 
 
27
  return lod
28
 
29
  with gr.Blocks() as app:
 
11
  r = requests.get(f'{rss_url}')
12
  soup = bs4.BeautifulSoup(r.content,'lxml')
13
  for i,p in enumerate(soup.find_all("a")):
14
+ if ".xml" in p['href'] or ".json" in p['href'] or ".rss" in p['href']:
15
  print (p['href'])
16
  json_dict[p.text]=p['href']
17
  json_box.append(json_dict)
 
22
  if ".json" in rss_url:
23
  lod = json.loads(r.text)
24
  if ".xml" in rss_url:
 
25
  lod = xmltodict.parse(r.text)
26
+ if ".rss" in rss_url:
27
+ lod = xmltodict.parse(r.text)
28
  return lod
29
 
30
  with gr.Blocks() as app: