Skip to content

fix: ThurrockCouncil - accept real postcode + house number#1991

Closed
InertiaUK wants to merge 1 commit into
robbrad:masterfrom
InertiaUK:fix/ThurrockCouncil-real-address
Closed

fix: ThurrockCouncil - accept real postcode + house number#1991
InertiaUK wants to merge 1 commit into
robbrad:masterfrom
InertiaUK:fix/ThurrockCouncil-real-address

Conversation

@InertiaUK
Copy link
Copy Markdown
Contributor

Replaces the magic-token date calculator with a real address-based lookup.

Problem: The old scraper required paon="Monday" and postcode="Round A" — users had to already know their collection day and round. Unusable for any system that passes real addresses.

Fix: Resolves the street name from postcode via postcodes.io + Nominatim reverse geocoding, then scrapes the relevant alphabetical page from thurrock.gov.uk to find the matching street entry (with town disambiguation for streets that exist in multiple towns). Calculates dates using the same alternating rota logic.

Changes:

  • ThurrockCouncil.py — full rewrite with street lookup
  • input.json — updated to use real postcode + house_number (was magic tokens)

Testing: Verified with RM17 6TX / 10 (Mace Court, Grays) — returns 140 bins (Green/Grey, Blue, Brown, Food across 28 weeks).

The old scraper was a pure date calculator that required magic tokens:
paon="Monday" and postcode="Round A". Users had to already know their
collection day and round, making it unusable for address-based lookups.

Rewritten to resolve the street name and match against the council's
published street tables:
- postcodes.io resolves postcode to lat/lng
- Nominatim reverse-geocodes to get street name and town
- Scrapes the relevant alphabetical page from thurrock.gov.uk
- Matches street name (with town disambiguation)
- Calculates dates using the same alternating rota logic

Falls back to extracting street from paon if it contains more than
just a house number (e.g. "10 Mace Court").
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 1, 2026

Warning

Rate limit exceeded

@InertiaUK has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 59 minutes and 39 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d66d1ba0-ef85-4bc6-bfcf-601ef8c2e393

📥 Commits

Reviewing files that changed from the base of the PR and between 60bd3cc and e251cb5.

📒 Files selected for processing (2)
  • uk_bin_collection/tests/input.json
  • uk_bin_collection/uk_bin_collection/councils/ThurrockCouncil.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 59 minutes and 39 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@robbrad robbrad mentioned this pull request May 1, 2026
@robbrad
Copy link
Copy Markdown
Owner

robbrad commented May 1, 2026

Included in May 2026 Release PR #1992. Closing.

@robbrad robbrad closed this May 1, 2026
@robbrad robbrad mentioned this pull request May 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants