Skip to content

Commit

Permalink
Merge branch 'argonism:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
argonism authored Jul 5, 2023
2 parents 224f281 + 7fea9fa commit 598a7f9
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 26 deletions.
11 changes: 5 additions & 6 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ pyyaml = "^5.3.1"
beautifulsoup4 = "^4.9.3"
selenium = "^3.141.0"
webdriver-manager = "^3.3.0"
arxiv = "^0.5.3"
urllib3 = "^1.26.15"
arxiv = "^1.4.7"

[tool.poetry.dev-dependencies]

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ pyyaml==5.3.1
beautifulsoup4==4.9.0
chromedriver-binary==87.0.4280.88.0
selenium==3.141.0
arxiv==0.5.3
arxiv
webdriver-manager==3.3.0
36 changes: 18 additions & 18 deletions src/carrier_owl.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ def search_keyword(
results = []

for article in articles:
url = article['arxiv_url']
title = article['title']
abstract = article['summary']
url = article.entry_id
title = article.title
abstract = article.summary
if len(keywords) > 0:
score, hit_keywords = calc_score(abstract, keywords)
else:
Expand Down Expand Up @@ -193,23 +193,23 @@ def main():
keywords = config['keywords'] if 'keywords' in config else {}
score_threshold = float(config['score_threshold'])

day_before_yesterday = datetime.datetime.today() - datetime.timedelta(days=1)
day_before_yesterday_str = day_before_yesterday.strftime('%Y%m%d')
# datetime format YYYYMMDDHHMMSS
arxiv_query = f'({subject}) AND ' \
f'submittedDate:' \
f'[{day_before_yesterday_str}000000 TO {day_before_yesterday_str}235959]'
articles = arxiv.query(query=arxiv_query,
max_results=1000,
sort_by='submittedDate',
iterative=False)
day_before_yesterday = datetime.datetime.today() - datetime.timedelta(days=2)

arxiv_query = f"{subject}"
search = arxiv.Search(query=arxiv_query,
max_results=100,
sort_by=arxiv.SortCriterion.LastUpdatedDate)
articles = []
for result in search.results():
if result.updated.date() == day_before_yesterday.date():
articles.append(result)

note = ''
if len(articles) <= 0:
articles = arxiv.query(query=f'{subject}',
max_results=100,
sort_by='submittedDate',
iterative=False)
articles = random.choices(articles, k=10)
articles = arxiv.Search(query=f'{subject}',
max_results=500,
sort_by=arxiv.SortCriterion.LastUpdatedDate).results()
articles = random.choices(list(articles), k=10)
note = 'Randomly displays 10 of the last 100 results'
results = search_keyword(articles, keywords, score_threshold, translate=translate)

Expand Down

0 comments on commit 598a7f9

Please sign in to comment.