cloakings / cloakings-palladium
Cloakings Palladium 客户端
1.2.0
2024-06-26 15:57 UTC
Requires
- php: >=8.3
- ext-curl: *
- cloakings/cloakings-common: ^1.1
- gupalo/json: ^1.0
- psr/log: ^3.0
- symfony/http-client: ^7.1
Requires (Dev)
- phpunit/phpunit: ^10.5
README
使用palladium.expert检测用户是机器人还是真实用户
安装
composer require cloakings/cloakings-palladium
使用方法
基本使用
在https://palladium.expert注册。创建活动
- 目标页面的链接:
real.php
- 机器人的链接:
fake.php
点击“下载代码”获取纯PHP或WordPress的代码,查找
- clientId
- clientCompany
- clientSecret
$request = \Symfony\Component\HttpFoundation\Request::createFromGlobals(); $cloaker = \Cloakings\CloakingsPalladium\PalladiumCloaker( clientId: $clientId, clientCompany: $clientCompany, clientSecret: $clientSecret, ); $cloakerResult = $cloaker->handle($request);
检查结果模式是否为CloakModeEnum::Fake
或CloakModeEnum::Real
并对其进行处理。
如果您想像原始Palladium库一样渲染结果
$baseIncludeDir = __DIR__; // change to your dir with real.php and fake.php $renderer = \Cloakings\CloakingsPalladium\PalladiumRenderer(); $response = $renderer->render($cloakerResult);
如果您的文件名与real.php
和fake.php
不同,请更改在$fakeTargetContains
和$realTargetContains
。
默认流量来源是PalladiumTrafficSourceEnum::Adwords
,但您可以将其更改为Facebook
或Tiktok
。
原始逻辑
原始库位于doc/original
php
- 纯PHP集成wordpress
- WordPress集成
此存储库的许可证不涵盖该代码。