added some logic fixes regarding spider output read
This commit is contained in:
parent
92c8b3a6f7
commit
e17fa6261a
2 changed files with 23 additions and 20 deletions
|
@ -120,26 +120,29 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
data[room_fdb] = iterdict
|
data[room_fdb] = iterdict
|
||||||
|
|
||||||
for i in eval(iteration_var_list):
|
for i in eval(iteration_var_list):
|
||||||
|
try:
|
||||||
|
print(room_fdb, i)
|
||||||
|
for key in data[room_fdb][i]:
|
||||||
|
contains_tag = False
|
||||||
|
for tag in eval(room_tags):
|
||||||
|
if tag in (data[room_fdb][i][key]["name"].split(' ') or data[room_fdb][i][key]["info"].split(' ') or data[room_fdb][i][key]["text"].split(' ')):
|
||||||
|
contains_tag = True
|
||||||
|
if contains_tag == True:
|
||||||
|
|
||||||
|
try:
|
||||||
|
url = data[room_fdb][i][key]["domain"]
|
||||||
|
except:
|
||||||
|
url = data[room_fdb][i][key]["link"]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
entry_message = '<' + url + '|' + data[room_fdb][i][key]["name"]+ '>' + '\n' + data[room_fdb][i][key]["info"]
|
||||||
|
|
||||||
|
api.send_message(entry_message, room[0])
|
||||||
|
|
||||||
for key in data[room_fdb][i]:
|
except Exception as e:
|
||||||
contains_tag = False
|
print("probably i was not there in last page, original error is:", e)
|
||||||
for tag in eval(room_tags):
|
|
||||||
if tag in (data[room_fdb][i][key]["name"].split(' ') or data[room_fdb][i][key]["info"].split(' ') or data[room_fdb][i][key]["text"].split(' ')):
|
|
||||||
contains_tag = True
|
|
||||||
if contains_tag == True:
|
|
||||||
|
|
||||||
try:
|
|
||||||
url = data[room_fdb][i][key]["domain"]
|
|
||||||
except:
|
|
||||||
url = data[room_fdb][i][key]["link"]
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
entry_message = '[' + url + ']' + data[room_fdb][i][key]["name"] + '\n' + data[room_fdb][i][key]["info"]
|
|
||||||
|
|
||||||
api.send_message(entry_message, room[0])
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
printfdbs§%§%cm9qFkkcbXdKuzXmC
|
createroom fdbspider-mobi ['giz','foerderinfo.bund.de-bekanntmachungen'] ['Energie','Mobilität','Wasserstoff','Solarenergie','regenerative','regenerativ','erneuerbar','Transport']§%§%nCqXY7riWQkZStD8Y
|
Loading…
Reference in a new issue