cloakings/cloakings-palladium

Cloakings Palladium 客户端

1.2.0 2024-06-26 15:57 UTC

This package is auto-updated.

Last update: 2024-09-26 16:32:38 UTC


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::FakeCloakModeEnum::Real并对其进行处理。

如果您想像原始Palladium库一样渲染结果

$baseIncludeDir = __DIR__; // change to your dir with real.php and fake.php
$renderer = \Cloakings\CloakingsPalladium\PalladiumRenderer();
$response = $renderer->render($cloakerResult);

如果您的文件名与real.phpfake.php不同,请更改在构造函数中的参数$fakeTargetContains$realTargetContains

默认流量来源是PalladiumTrafficSourceEnum::Adwords,但您可以将其更改为FacebookTiktok

原始逻辑

原始库位于doc/original

  • php - 纯PHP集成
  • wordpress - WordPress集成

此存储库的许可证不涵盖该代码。