$ show r-a-y/mobile-hosts
This repository is a lightweight PHP CLI tool that converts ad-blocking filter lists (primarily from AdGuard's CNAME tracker research and EasyPrivacy) into HOSTS-format blocklists. The core script, converter.php, fetches upstream lists from hardcoded URLs, parses domain entries, and outputs files containing '0.0.0.0 <domain>' lines. The generated .txt files (e.g., AdguardMobileAds.txt, EasyPrivacy3rdParty.txt) are committed to the repository and meant to be consumed by HOSTS-file-based ad blockers on mobile devices. The architecture is intentionally minimal: a single PHP script handles conversion, a shell script (.check.sh) automates periodic updates by committing only when the diff is exactly one line, and a GitHub Actions workflow (php.yml) runs the converter on a schedule. The tool is designed for manual or scheduled regeneration, not as a live service. It relies on upstream AdGuard lists, which introduces a maintenance risk if those sources change format or disappear. The repository is a hybrid of application code and generated data artifacts, but the dominant character is a small utility application. The converter is generic enough to accept custom list names and URLs, making it reusable for other filter-list-to-hosts conversions. However, the conversion is lossyβmany filter options (e.g., $domain, $third-party, $redirect) are ignoredβand there are no tests or CI validation for the converter logic. The project is functional for its niche but shows signs of technical drift and brittle upstream coupling.
The LLM identified 1 files worth highlighting for reuse:
A self-contained PHP CLI script that fetches ad-filter lists (AdGuard, EasyPrivacy) and converts them to HOSTS-format blocklists. It accepts 'name' and 'url' parameters, making it a generic converter for any filter-list-to-hosts transformation. The script demonstrates a clean separation of concerns: fetching, parsing, and output generation, and is easily reusable in other projects that need to convert ad-block syntax to hosts format.