$ show RSS-Bridge/rss-bridge
RSS-Bridge is a PHP web application that generates RSS, Atom, and JSON feeds for websites that do not natively provide them. The core architecture is a plugin framework: each of the 447 'bridges' in bridges/ extends BridgeAbstract (or FeedExpander/XPathAbstract/CssSelectorBridge) and implements collectData() to scrape HTML, consume JSON APIs, parse embedded JSON-LD/Next.js state, or expand existing feeds into a standardized item structure. A front controller (index.php) dispatches through a middleware pipeline (security, caching, basic/token auth, exception handling) to actions such as DisplayAction, FrontpageAction, ListAction, and FindfeedAction, then renders items via pluggable output formats (Atom, MRSS, JSON Feed, HTML, Plaintext, Sfeed). Both web and CLI request paths are supported, and the Docker deployment is production-ready with nginx + PHP-FPM and curl-impersonate for anti-bot evasion. The framework itself demonstrates solid engineering: a lightweight DI container, factory classes for bridge/format/cache discovery, a well-designed HTTP client layer with retry logic and CloudFlare detection, a standalone RSS 1.0/2.0/Atom/MediaRSS feed parser, systematic SEO/JSON-LD metadata extraction, and multiple cache backends (file, SQLite WAL, memcached, null) with TTL policies. PHPUnit tests cover feed parsing, format output snapshots, cache implementations, parameter validation, and BridgeImplementationTest enforces structural conventions across all bridges. The bridge base-class conventions (PARAMETERS arrays, contexts, detectParameters, throwClientException/throwServerException) are consistent and well-documented. The dominant weakness is inherent to the scraping domain: most bridges rely on brittle CSS selectors, undocumented APIs, or hardcoded endpoints that break as upstream sites change. Known issues visible in code include hardcoded API keys (Formula1, Giphy, Instructables, TwitterClient), deprecated/duplicate bridges (VkBridge states 'Does not work anymore'; Mozilla and Kernel BugTracker bridges defer to BugzillaBridge), logic bugs (Modrinth parameter key typo, GGDeals assignment-in-condition, Steam assignment-in-condition), a PHP 7.4 compatibility floor (EOL since 2022), and bundled Parsedown 1.7.4. The anti-bot arms race adds ongoing maintenance burden, and many low-traffic bridges appear effectively unmaintained. Overall, the core framework is a strong, extensible example of plugin-style feed generation architecture with genuinely reusable components; the bridge corpus is heterogeneous in quality, mixing well-crafted adapters with fragile scrapers. The project is actively maintained with recent commits, CI workflows, and a large contributor base.
The LLM identified 5 files worth highlighting for reuse:
Standalone parser supporting RSS 1.0/2.0, Atom, and iTunes/Media RSS modules, producing a standardized array structure consumed by FeedExpander bridges. Self-contained with no internal project dependencies, covered by dedicated unit tests, and directly extractable into any PHP project needing syndication feed ingestion.
HttpClient abstraction with CurlHttpClient implementation, Request/Response wrappers, multi-header response handling, retry logic, CloudFlare detection, and max file size enforcement. A genuinely reusable HTTP layer that could be extracted as a standalone PHP library with minimal modification.
Systematically extracts title, content, timestamp, enclosures, and author from HTML meta tags and JSON-LD structured data (article, newsarticle, person types). Demonstrates non-obvious knowledge of SEO/OpenGraph markup patterns and solves a recurring web-scraping problem; reusable across any PHP scraping project.
TTL-aware SQLite key-value cache using WAL mode, serialized blobs, timestamp-based expiration, and prune()/clear() operations. A clean CacheInterface implementation that is self-contained, well-structured, and could be reused as a persistent cache backend in any PHP application.
Declarative scraping base class where subclasses define XPath expressions as class constants and optionally override formatting methods (formatItem, formatTimestamp, extractContent). Reduces what would be dozens of imperative scraper implementations into small declarative configurations - a clever template-method pattern for XPath-based feed extraction.