|
@@ -9,7 +9,7 @@ from bs4 import BeautifulSoup
|
|
|
from ollama import Client as oClient
|
|
from ollama import Client as oClient
|
|
|
from send_matrix import MatrixBot
|
|
from send_matrix import MatrixBot
|
|
|
|
|
|
|
|
-key = 'web3'
|
|
|
|
|
|
|
+key_list = 'web3'
|
|
|
text_batch = 0
|
|
text_batch = 0
|
|
|
|
|
|
|
|
|
|
|
|
@@ -46,7 +46,7 @@ class AINEWS:
|
|
|
file = os.path.join(save_file_path, str(int(time.time())) + '.txt')
|
|
file = os.path.join(save_file_path, str(int(time.time())) + '.txt')
|
|
|
with open(file, 'w', encoding='utf-8') as file:
|
|
with open(file, 'w', encoding='utf-8') as file:
|
|
|
file.write(str(url_to_text))
|
|
file.write(str(url_to_text))
|
|
|
- print(f'txt文件已保存, 路径为: {file}')
|
|
|
|
|
|
|
+ print(f'txt文件已保存')
|
|
|
|
|
|
|
|
def load_config(self, key):
|
|
def load_config(self, key):
|
|
|
config = {}
|
|
config = {}
|
|
@@ -144,6 +144,8 @@ class AINEWS:
|
|
|
if __name__ == "__main__":
|
|
if __name__ == "__main__":
|
|
|
ainews = AINEWS()
|
|
ainews = AINEWS()
|
|
|
ainews.create_config_if_not_exists()
|
|
ainews.create_config_if_not_exists()
|
|
|
- target_url_list, prompt_words, role = ainews.load_config(key)
|
|
|
|
|
- ainews.main(target_url_list, prompt_words, role)
|
|
|
|
|
|
|
+
|
|
|
|
|
+ for key in key_list:
|
|
|
|
|
+ target_url_list, prompt_words, role = ainews.load_config(key)
|
|
|
|
|
+ ainews.main(target_url_list, prompt_words, role)
|
|
|
print('done!')
|
|
print('done!')
|