Omnibus commited on
Commit
d63eaaf
·
verified ·
1 Parent(s): b9b4a1a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -198,11 +198,13 @@ def find_all(purpose,task,history, rss_url, result):
198
  return "MAIN", None, history, task, result
199
  """
200
  def find_rss():
 
201
  out_box=[]
202
  with open ('feeds.json','r') as j:
203
  cont = json.loads(j.read())
204
  #print(cont)
205
  for ea in cont:
 
206
  print (ea['link'])
207
  rss_url=ea['link']
208
  r = requests.get(f'{rss_url}')
@@ -231,8 +233,10 @@ def find_rss():
231
  r_link = lod['rss']['channel']['item'][i]['link']
232
  r_title = lod['rss']['channel']['item'][i]['title']
233
  r_description = lod['rss']['channel']['item'][i]['description']
234
- print({"title":r_title, "description":r_description,"link":r_link})
235
  except Exception as e:
 
 
236
  print(f'Exception::{e}')
237
  out_box.append(lod)
238
  yield out_box
 
198
  return "MAIN", None, history, task, result
199
  """
200
  def find_rss():
201
+ lod=""
202
  out_box=[]
203
  with open ('feeds.json','r') as j:
204
  cont = json.loads(j.read())
205
  #print(cont)
206
  for ea in cont:
207
+ lod=""
208
  print (ea['link'])
209
  rss_url=ea['link']
210
  r = requests.get(f'{rss_url}')
 
233
  r_link = lod['rss']['channel']['item'][i]['link']
234
  r_title = lod['rss']['channel']['item'][i]['title']
235
  r_description = lod['rss']['channel']['item'][i]['description']
236
+ lod = {"title":r_title, "description":r_description,"link":r_link}
237
  except Exception as e:
238
+ lod += f'{rss_url} ::ERROR:: {e}'
239
+
240
  print(f'Exception::{e}')
241
  out_box.append(lod)
242
  yield out_box