Skip to content

Commit

Permalink
Merge pull request #955 from open-contracting/931-plateau-state
Browse files Browse the repository at this point in the history
add nigeria_plateau_state spider
  • Loading branch information
yolile committed Aug 3, 2022
2 parents c9140f6 + a032757 commit fba225e
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
7 changes: 7 additions & 0 deletions docs/spiders.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,13 @@ Nigeria
scrapy crawl nigeria_oyo_state
.. autoclass:: kingfisher_scrapy.spiders.nigeria_plateau_state.NigeriaPlateauState
:no-members:

.. code-block:: bash
scrapy crawl nigeria_plateau_state
.. autoclass:: kingfisher_scrapy.spiders.nigeria_portal.NigeriaPortal
:no-members:

Expand Down
19 changes: 19 additions & 0 deletions kingfisher_scrapy/spiders/nigeria_plateau_state.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import scrapy

from kingfisher_scrapy.base_spiders import SimpleSpider


class NigeriaPlateauState(SimpleSpider):
"""
Domain
Nigeria Plateau State
Bulk download documentation
https://plateaustatebpp.com/ocds
"""
name = 'nigeria_plateau_state'

# SimpleSpider
data_type = 'release_package'

def start_requests(self):
yield scrapy.Request('https://plateaustatebpp.com/export', meta={'file_name': 'all.json'})
4 changes: 2 additions & 2 deletions kingfisher_scrapy/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def items_basecoro(target, prefix, map_type=None, skip_key=None):
path, the current event is skipped. Otherwise, the method is identical.
"""
while True:
current, event, value = (yield)
current, event, value = yield
if skip_key and skip_key in current:
continue
if current == prefix:
Expand All @@ -218,7 +218,7 @@ def items_basecoro(target, prefix, map_type=None, skip_key=None):
end_event = event.replace('start', 'end')
while (current, event) != (prefix, end_event):
builder.event(event, value)
current, event, value = (yield)
current, event, value = yield
del builder.containers[:]
target.send(builder.value)
else:
Expand Down
2 changes: 1 addition & 1 deletion tests/extensions/test_kingfisher_process_api2.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __init__(self, status_code=200, content=None):

@property
def ok(self):
return not(400 <= self.status_code < 600)
return not (400 <= self.status_code < 600)

def json(self):
return self.content
Expand Down

0 comments on commit fba225e

Please sign in to comment.