Skip to content

fix: EdinburghCityCouncil - accept real postcode + house number#1990

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

fix: EdinburghCityCouncil - accept real postcode + house number#1990
InertiaUK wants to merge 1 commit into
robbrad:masterfrom
InertiaUK:fix/EdinburghCityCouncil-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="Tuesday" and postcode="Week 1" — users had to already know their collection schedule code. Unusable for any system that passes real addresses.

Fix: Resolves the street name from postcode via postcodes.io + Nominatim reverse geocoding, then searches Edinburgh's waste collection directory at /directory/10251/ for the street, extracts the calendar code (e.g. Tue_2), and calculates dates using the same fortnightly rota logic.

Changes:

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

Testing: Verified with EH10 4AX / 157 (Morningside Road) — returns 84 bins (Grey, Green, Glass across 28 weeks).

The old scraper was a pure date calculator that required magic tokens:
paon="Tuesday" and postcode="Week 1". Users had to already know their
collection schedule code, making it unusable for address-based lookups.

Rewritten to resolve the street name automatically and look up the
schedule code from the council's directory:
- postcodes.io resolves postcode to lat/lng
- Nominatim reverse-geocodes to get street name
- Searches Edinburgh's /directory/10251/ for the street
- Extracts calendar code (e.g. Tue_2) from the record page
- Calculates dates using the same fortnightly rota logic

Falls back to extracting street from paon if it contains more than
just a house number (e.g. "157 Morningside Road").
@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 49 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: 1849f737-c6a5-4ce2-8d05-8a52e476f04f

📥 Commits

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

📒 Files selected for processing (2)
  • uk_bin_collection/tests/input.json
  • uk_bin_collection/uk_bin_collection/councils/EdinburghCityCouncil.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 49 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