-
-
Notifications
You must be signed in to change notification settings - Fork 658
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
Adding thanet gov uk and wakefield gov uk #2954
Conversation
Added Thanet District Council
Have seen that others have tried but come across blocking by Incapsula, but this seems to work - I am likely missing something though.
…k/hacs_waste_collection_schedule into adding_thanet_gov_uk
url = f"https://www.thanet.gov.uk/wp-content/mu-plugins/collection-day/incl/mu-collection-day-calls.php?pAddress={self._uprn}" | ||
collections_json = requests.get(url, headers= self.header_text).json() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to use the params parameter instad of encoding the arguments in the url string
url = "https://www.thanet.gov.uk/wp-content/mu-plugins/collection-day/incl/mu-collection-day-calls.php"
collections_json = requests.get(url, headers= self.header_text, params={"pAddress": self._uprn}).json()
return entries | ||
|
||
def get_uprn(self) -> str: | ||
url = f"https://www.thanet.gov.uk/wp-content/mu-plugins/collection-day/incl/mu-collection-day-calls.php?searchAddress={requests.utils.quote(self._postcode)}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the params
argument instead of using requests.utils.quote
I think it's a good idea to check if self._postcode and self._street_address is set. If no argument is set (which is possible with this init arguments, the source throws TypeError: quote_from_bytes() expected bytes
which is not really explanatory.
You could throw SourceArgumentRequired
if postcode
is missing and SourceArgumentRequiredWithSuggestions
if postcode
is set but not street_address
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I've done this as described (a couple of days on from Hello World here so all of your points are really appreciated, I hope it's not too frustrating from your side. I've tried to learn by examples I have seen but these direct pointers are incredibly helpful).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not frustrating at all. I appreciate your work and am happy to help.
...om_components/waste_collection_schedule/waste_collection_schedule/source/wakefield_gov_uk.py
Outdated
Show resolved
Hide resolved
...om_components/waste_collection_schedule/waste_collection_schedule/source/wakefield_gov_uk.py
Outdated
Show resolved
Hide resolved
...om_components/waste_collection_schedule/waste_collection_schedule/source/wakefield_gov_uk.py
Outdated
Show resolved
Hide resolved
You do not need to create a new PR as you did with the Sefton PR. But you can just push changes to your northerngeek:adding_thanet_gov_uk branch. |
Thank you @5ila5, I hope I've done everything correctly, and thank you again for your help. |
Thanks for your contribution |
Added Thanet District Council, UK in response to request #2928
Also adds Wakefield Council, UK in response to #305 and #1017 (both of these say there's a blocking issue, but I am not encountering it yet, not sure if the issue has disappeared?)