Skip to content

Commit

Permalink
fix single day collection and make other periods include morning and …
Browse files Browse the repository at this point in the history
…afternoon of first and last day! (#372)
  • Loading branch information
boogheta committed Jul 7, 2021
1 parent 6ad3a7a commit 3319591
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hyphe_backend/crawler/hcicrawler/spiders/pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ def __init__(self, **kwargs):
archivedate = re.sub(r"\D", "", str(self.webarchives["date"]))
self.archivedate = str(archivedate) + "120000"
archivedt = datetime.strptime(self.archivedate, "%Y%m%d%H%M%S")
self.archivemindate = datetime.strftime(archivedt - timedelta(self.webarchives["days_range"]/2.), "%Y%m%d%H%M%S")
self.archivemaxdate = datetime.strftime(archivedt + timedelta(self.webarchives["days_range"]/2.), "%Y%m%d%H%M%S")
self.archivemindate = datetime.strftime(archivedt - timedelta(days=self.webarchives["days_range"]/2., seconds=43200), "%Y%m%d%H%M%S")
self.archivemaxdate = datetime.strftime(archivedt + timedelta(days=self.webarchives["days_range"]/2., seconds=43199), "%Y%m%d%H%M%S")

archiveprefix = self.webarchives["url_prefix"].rstrip('/')
self.archiveprefix = "%s/%s/" % (archiveprefix, self.archivedate)
Expand Down

0 comments on commit 3319591

Please sign in to comment.