feat: Internet Archive Collector#585
Open
labradorite-dev wants to merge 5 commits intoPolice-Data-Accessibility-Project:devfrom
Open
feat: Internet Archive Collector#585labradorite-dev wants to merge 5 commits intoPolice-Data-Accessibility-Project:devfrom
labradorite-dev wants to merge 5 commits intoPolice-Data-Accessibility-Project:devfrom
Conversation
Implement a new collector that uses the Internet Archive CDX API to discover archived URLs on domains PDAP already knows about. Users provide seed URLs, domains are extracted, and the Wayback Machine is searched for all archived pages with filtering for mime types, URL patterns, and dedup.
…e crawler Add mocked integration tests (happy path, empty domain, API error) and a manual lifecycle test hitting the live CDX API. Also fix missing 'internet_archive' value in batch_strategy DB enum and SQLAlchemy model.
The mime_type_allowlist already filters out non-HTML content, making the static asset file extension patterns unnecessary.
maxachis
requested changes
Feb 16, 2026
Collaborator
maxachis
left a comment
There was a problem hiding this comment.
This is looking good! The last thing I'd ask for is three small things:
- Make sure it passes flake8 linting.
- Have it point to dev, rather than main, for the merge
- When you run the manual test, just provide around 10 of the URLs it gathers.
Do all that, and this will be good to merge!
|
|
||
|
|
||
| def upgrade() -> None: | ||
| switch_enum_type( |
Collaborator
There was a problem hiding this comment.
Good call on this! It also reminded me that having an enum as a column is an antipattern, which I've noted for addressing here.
Author
Manual Test Results — Sample URLsRan the Internet Archive crawler against couple URLs Domain:
|
| # | URL |
|---|---|
| 1 | http://www.cityofchicago.org:80/ |
| 2 | http://www.cityofchicago.org:80/AboutTown.html |
| 3 | http://www.cityofchicago.org:80/AdminHearings/ |
| 4 | http://www.cityofchicago.org:80/AdminHearings/About.html |
| 5 | http://www.cityofchicago.org:80/AdminHearings/Contacts.html |
| 6 | http://www.cityofchicago.org:80/AdminHearings/Division.html |
| 7 | http://www.cityofchicago.org:80/AdminHearings/FAQ.html |
| 8 | http://www.cityofchicago.org:80/AdminHearings/Hearing.html |
| 9 | http://cityofchicago.org:80/AdminHearings/AdminLawOfficers.html |
| 10 | http://www.cityofchicago.org:80/AdminHearings/AHPubServIntern.html |
Add missing module, class, and method docstrings (D100-D107) and type annotations (ANN101, ANN001, ANN201, ANN204) to all Internet Archive collector files to satisfy flake8 linting requirements.
Author
|
May I also suggest a hook using |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves #379 by creating an internet archive collector. Tested via unit tests and manual test script.
I tried my best to follow repo standards but if there's anything I can do better pls let me know!