Skip to content

Commit

Permalink
Update main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
wanghaisheng committed Jul 27, 2024
1 parent 6ac42fd commit 83938bc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 83938bc

Please sign in to comment.