Fix for Python 3.9+/current arXiv + switch to the official arXiv API - #38
Open
svemulapati wants to merge 2 commits into
Open
svemulapati wants to merge 2 commits into
svemulapati wants to merge 2 commits into
Conversation
- Replace removed HTMLParser.unescape() with html.unescape() - Extract abs/pdf links via regex instead of brittle line offsets (arXiv inserted a wrapper div, breaking the old index math) - Decode arXiv response as UTF-8 to fix author-name mojibake - Auto-configure SSL via certifi so nltk/arXiv requests work on macOS without manual cert setup - Add .gitignore for venv/build artifacts Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Query export.arxiv.org/api/query (public, no registration) and parse the returned Atom XML with ElementTree, replacing the brittle search-page scraper that broke whenever arXiv changed its HTML layout. - Robust XML parsing of title/abstract/authors/date/links - Keyword-based CS-only filtering via 'cat:cs.*' for plain English words, all-of-arXiv for jargon (preserves original behavior) - Client-side pagination with a polite >=3s delay between requests - Keep the abstract-summarization logic (numbers/SOTA prioritization) - Drop now-unused 'six' dependency Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
This PR gets
sotawhatworking again on modern Python and a current arXiv, and makes it resilient to future arXiv changes. The script had stopped working on Python 3.9+ and against arXiv's current site.Fixes (script was broken on Python 3.9+ / current arXiv)
HTMLParser.unescape()withhtml.unescape()(removed in Python 3.9).certifi, sonltkdownloads and arXiv requests work on macOS without the manual "Install Certificates" step.Improvement: use the official arXiv API
xml.etree.ElementTree. This removes the brittleness that broke the tool whenever arXiv changed its page layout.>= 3sdelay between paged requests, per arXiv's API terms of use.sixdependency.Unchanged
sotawhat <keyword> [count](default 5).Tested locally across several keywords (
transformer,language model,perplexity,GAN,wikitext) plus the no-result path.🤖 Generated with Claude Code