diff --git a/fdb_spider_interface.py b/fdb_spider_interface.py index 0f8a30e..428b124 100644 --- a/fdb_spider_interface.py +++ b/fdb_spider_interface.py @@ -4,7 +4,7 @@ import configparser import json import requests import yaml - +import dateutil.parser import subprocess config = configparser.ConfigParser() @@ -179,6 +179,7 @@ if __name__ == '__main__': print(room_fdb, i) for key in data[room_fdb][i]: contains_tag = False + period_data_formatted = dateutil.parser.parse(data[room_fdb][i][key]["period"]) name_data_lower = [word.lower() for word in data[room_fdb][i][key]["name"].split(' ')] info_data_lower = [word.lower() for word in data[room_fdb][i][key]["info"].split(' ')] text_data_lower = [word.lower() for word in data[room_fdb][i][key]["text"].split(' ')] @@ -237,7 +238,7 @@ if __name__ == '__main__': except: url = data[room_fdb][i][key]["link"] - entry_message = '<' + url + '|' + data[room_fdb][i][key]["name"]+ '>' + '\n' + data[room_fdb][i][key]["info"] + '\n' + str(tag_list) + entry_message = '<' + url + '|' + data[room_fdb][i][key]["name"]+ '>' + '\n' + data[room_fdb][i][key]["info"] + '\n' + 'The period of the entry is:' + str(period_data_formatted) + '\n' + str(tag_list) entry_message_identifier = '<' + url + '|' + data[room_fdb][i][key]["name"]+ '>' message_was_already_there = False @@ -406,7 +407,7 @@ if __name__ == '__main__': command : `updaterooms ` example : `updaterooms 6572012bebb39dd248d08320` ----------------------------------------------------------------------------------------- - To create a room use following command, but be sure to not have spaces in your lists, + To create a room use following command, but be sure to **not have spaces** in your lists, as a space indicates a new command argument: command : `createroom ` example : `createroom room-test-1 ['giz','fdb2'] ['tag1','tag2','tag3']` @@ -441,8 +442,12 @@ if __name__ == '__main__': room_file_list = room_file_raw.split('§%§%') room_list.append([room[:-4], room_file_list[0], room_file_list[1], room_file_list[2]]) + room_list_string = '' + for room in room_list: + room_list_string += str(room) + '\n' + '------------------------------------------------------------------------------' + '\n' + #print(room_list) - answer = str(room_list) + answer = room_list_string if user_input_list[0] == 'updaterooms': try: @@ -538,6 +543,7 @@ if __name__ == '__main__': print(room_fdb, i) for key in data[room_fdb][i]: contains_tag = False + period_data_formatted = dateutil.parser.parse(data[room_fdb][i][key]["period"]) name_data_lower = [word.lower() for word in data[room_fdb][i][key]["name"].split(' ')] info_data_lower = [word.lower() for word in data[room_fdb][i][key]["info"].split(' ')] text_data_lower = [word.lower() for word in data[room_fdb][i][key]["text"].split(' ')] @@ -630,7 +636,7 @@ if __name__ == '__main__': print('101110001101010010010101000111') - entry_message = '<' + url + '|' + data[room_fdb][i][key]["name"]+ '>' + '\n' + data[room_fdb][i][key]["info"] + '\n' + str(tag_list) + entry_message = '<' + url + '|' + data[room_fdb][i][key]["name"]+ '>' + '\n' + data[room_fdb][i][key]["info"] + '\n' + 'The period of the entry is:' + str(period_data_formatted) + '\n' + str(tag_list) entry_message_identifier = '<' + url + '|' + data[room_fdb][i][key]["name"]+ '>' diff --git a/new_message_file.txt b/new_message_file.txt index db8ee60..982ba74 100644 --- a/new_message_file.txt +++ b/new_message_file.txt @@ -1 +1 @@ -updaterooms 657c97e5ebb39dd248d38d51§%§%BvLofBxRKbtk9AHkK \ No newline at end of file +printcommands§%§%WM56LadJhkYBuGayZ \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 490e9d5..767982b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,10 @@ certifi==2023.7.22 charset-normalizer==3.2.0 idna==3.4 +python-dateutil==2.8.2 PyYAML==6.0.1 requests==2.31.0 rocket-python==1.3.4 schedule==1.2.1 +six==1.16.0 urllib3==2.0.4 diff --git a/roomhistories/657c97e5ebb39dd248d38d51.txt b/roomhistories/657c97e5ebb39dd248d38d51.txt index 61383ca..a4829fa 100644 --- a/roomhistories/657c97e5ebb39dd248d38d51.txt +++ b/roomhistories/657c97e5ebb39dd248d38d51.txt @@ -1 +1,13 @@ + + + + + + + + + + + +