Spaces:
Sleeping
Sleeping
Commit History
-
Add rate limiting, tests, better extraction, and HF auto-deploy
Claude +1: Claude Sonnet 5Unverified signatureBuilt via TDD: each module below was preceded by a failing test suite in tests/, then implemented to pass it (66 tests total). - Restructure main.py into app/ modules (config, security, rate_limit, cache, extractor, scraper, main) instead of one file. - Add a per-IP sliding-window rate limiter and an optional API key gate on /scrape, closing the abuse/cost gap on an endpoint that launches a real browser per call. - Replace the regex-based ad/nav-stripping heuristic with trafilatura, a readability-style extractor that identifies boilerplate instead of pattern-matching class/id substrings (fewer false-positive removals of legitimate content). - Add a short-TTL in-memory cache so repeat requests for the same URL skip re-rendering with a full browser. - Add .github/workflows/ci-deploy.yml: runs the test suite on every push/PR, then pushes to the Hugging Face Space's main branch (needs an HF_TOKEN repository secret) so deploys no longer require a manual git push. - Upda…ebab0e2