Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(spiders): use date filters as part of file names #1026

Merged
merged 11 commits into from
Sep 20, 2023
6 changes: 3 additions & 3 deletions kingfisher_scrapy/spiders/kyrgyzstan.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ class Kyrgyzstan(LinksSpider):

def start_requests(self):
jpmckinney marked this conversation as resolved.
Show resolved Hide resolved
url = 'http://ocds.zakupki.gov.kg/api/tendering'
file_name = 'start.json'
if self.from_date:
from_date = self.from_date.strftime(self.date_format)
# The API requires the timezone and seconds in the since parameter.
url = f'{url}?since={from_date}.00%2B06:00'
file_name = f'{from_date}-{file_name}'
yield scrapy.Request(url, meta={'file_name': file_name})
else:
from_date = '1970-01-01T00:00:00'
jpmckinney marked this conversation as resolved.
Show resolved Hide resolved
yield scrapy.Request(url, meta={'file_name': f'{from_date}.json'})