carono/php-adblock-parser
Composer 安装命令:
composer require carono/php-adblock-parser
包简介
PHP parser for Adblock Plus filters
README 文档
README
Usage
To learn about Adblock Plus filter syntax check these links:
-
Get filter rules somewhere: write them manually, read lines from a file downloaded from EasyList, etc.:
$rules = [ "||ads.example.com^", "@@||ads.example.com/notbanner^$~script", ];
-
Create AdblockRules instance from the rules array:
use Limonte\AdblockParser; $adblockParser = new AdblockParser($rules); $adblockParser->addRules($anotherRules);
-
Use this instance to check if an URL should be blocked or not:
$adblockParser->shouldBlock("http://ads.example.com"); // true $adblockParser->shouldBlock("http://non-ads.example.com"); // false
Related projects
- Google Safebrowsing PHP library: limonte/google-safebrowsing
- McAfee SiteAdvisor PHP library: limonte/mcafee-siteadvisor
- Check if link is SPAM: limonte/spam-link-analyser
- Python parser for Adblock Plus filters: scrapinghub/adblockparser
- EasyList filter subscription: easylist/easylist
统计信息
- 总下载量: 50
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-10-20