-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nigeria_budeshi: Share logic with Kaduna State Budeshi spiders
- Loading branch information
1 parent
34fc1ee
commit a7b9bf5
Showing
6 changed files
with
22 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 0 additions & 28 deletions
28
kingfisher_scrapy/spiders/nigeria_kaduna_state_budeshi_base.py
This file was deleted.
Oops, something went wrong.
16 changes: 6 additions & 10 deletions
16
kingfisher_scrapy/spiders/nigeria_kaduna_state_budeshi_records.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,15 @@ | ||
from kingfisher_scrapy.spiders.nigeria_kaduna_state_budeshi_base import NigeriaKadunaStateBudeshiBase | ||
from kingfisher_scrapy.spiders.nigeria_budeshi_records import NigeriaBudeshiRecords | ||
from kingfisher_scrapy.util import components | ||
|
||
|
||
class NigeriaKadunaStateBudeshiRecords(NigeriaKadunaStateBudeshiBase): | ||
class NigeriaKadunaStateBudeshiRecords(NigeriaBudeshiRecords): | ||
""" | ||
Domain | ||
Budeshi Nigeria - Kaduna State | ||
Budeshi Nigeria - Kaduna State | ||
API documentation | ||
https://www.budeshi.ng/kadppa/api | ||
https://www.budeshi.ng/kadppa/api | ||
""" | ||
name = 'nigeria_kaduna_state_budeshi_records' | ||
|
||
# SimpleSpider | ||
data_type = 'record_package' | ||
|
||
def build_urls(self, id): | ||
url = f'{self.base_url}record/{id}' | ||
yield self.build_request(url, formatter=components(-2)) | ||
# NigeriaBudeshiBase | ||
url_prefix = 'https://www.budeshi.ng/kadppa/api/' |
17 changes: 6 additions & 11 deletions
17
kingfisher_scrapy/spiders/nigeria_kaduna_state_budeshi_releases.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,15 @@ | ||
from kingfisher_scrapy.spiders.nigeria_kaduna_state_budeshi_base import NigeriaKadunaStateBudeshiBase | ||
from kingfisher_scrapy.spiders.nigeria_budeshi_releases import NigeriaBudeshiReleases | ||
from kingfisher_scrapy.util import components | ||
|
||
|
||
class NigeriaKadunaStateBudeshiReleases(NigeriaKadunaStateBudeshiBase): | ||
class NigeriaKadunaStateBudeshiReleases(NigeriaBudeshiReleases): | ||
""" | ||
Domain | ||
Budeshi Nigeria - Kaduna State | ||
Budeshi Nigeria - Kaduna State | ||
API documentation | ||
https://www.budeshi.ng/kadppa/api | ||
https://www.budeshi.ng/kadppa/api | ||
""" | ||
name = 'nigeria_kaduna_state_budeshi_releases' | ||
|
||
# SimpleSpider | ||
data_type = 'release_package' | ||
|
||
def build_urls(self, id): | ||
for tag in ('planning', 'tender', 'award', 'contract'): | ||
url = f'{self.base_url}releases/{id}/{tag}' | ||
yield self.build_request(url, formatter=components(-2)) | ||
# NigeriaBudeshiBase | ||
url_prefix = 'https://www.budeshi.ng/kadppa/api/' |