FIX: efemeridesbot error handling
This commit is contained in:
parent
44e133ece8
commit
4efacb7e50
|
@ -22,11 +22,14 @@ texts = {i: [] for i in years }
|
||||||
|
|
||||||
for event in events:
|
for event in events:
|
||||||
text = event.get_text()
|
text = event.get_text()
|
||||||
text_year = int(text.split(":")[0].split(u'\xa0')[0].split(" ")[0].split(",")[0])
|
try:
|
||||||
for year in years:
|
text_year = int(text.split(":")[0].split(u'\xa0')[0].split(" ")[0].split(",")[0])
|
||||||
if text_year < year:
|
for year in years:
|
||||||
texts[year].append(text)
|
if text_year < year:
|
||||||
break
|
texts[year].append(text)
|
||||||
|
break
|
||||||
|
except:
|
||||||
|
print("Error: " + text)
|
||||||
|
|
||||||
api = get_api('masto.es', 'efemeridesbot')
|
api = get_api('masto.es', 'efemeridesbot')
|
||||||
last_id = 0
|
last_id = 0
|
||||||
|
|
Loading…
Reference in New Issue