From 83938bc5aee876cb180344769bffe68961d8d9b4 Mon Sep 17 00:00:00 2001 From: HeisenBerg? Date: Sat, 27 Jul 2024 15:58:04 +0800 Subject: [PATCH] Update main.py --- main.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 7ad251f1..1f842947 100644 --- a/main.py +++ b/main.py @@ -138,6 +138,11 @@ def runtime(self, context: dict): # output = scraper.scrape() # cols = ("id", "title", "categories", "abstract", "doi", "created", "updated", "authors") # df = pd.DataFrame(output, columns=cols) + + if not os.path.exists(SERVER_DIR_STORAGE): + os.makedirs(SERVER_DIR_STORAGE) + print(f"Directory '{SERVER_DIR_STORAGE}' was created.") + self.max_results=2000 res = arxiv.Search( query="ti:"+keyword_+"+OR+abs:"+keyword_, max_results=self.max_results, @@ -504,7 +509,10 @@ def to_markdown(self, context: dict) -> dict: for paper in _paper_obj.values(): t=self._generate_markdown_table_content( paper,tags=[_topic,_subtopic]) - tt.append(t) + if not t: + pass + else: + tt.append(t) if len(tt)>0: table_lines = "".join(tt)