webignition/sfs-client

用于查询api.stopforumspam.com的HTTP客户端

0.2 2019-04-12 15:22 UTC

This package is auto-updated.

Last update: 2024-09-13 04:24:50 UTC


README

PHP HTTP客户端,用于查询api.stopforumspam.com

安装

composer require webignition/sfs-client

api.stopformumspam.com概述

api.stopforumspam.com可以通过电子邮件地址、电子邮件哈希、IP地址或用户名进行查询。可以提供可选标志来影响返回结果类型。

如果您不熟悉,请先阅读api.stopforumspam.com使用指南

使用方法

快速使用示例

use webignition\SfsClient\Client;
use webignition\SfsResultInterfaces\ResultInterface;

$client = new Cient();

// Query against a single email address
$result = $client->queryEmail('user@example.com');

// $result will be NULL if the HTTP request to query api.stopforumspam.com failed for any reason

if ($result instanceof ResultInterface) {
    $result->getType();                 // 'email', 'emailHash', 'ip' or 'username'
    $result->getFrequency();            // int
    $result->getAppears();              // bool
    $result->getValue();                // the email address, email hash, IP address or username
    $result->getLastSeen()              // \DateTime()|null
    $result->getConfidence()            // float|null
    $result->getDelegatedCountryCode(); // string|null
    $result->getCountryCode();          // string|null
    $result->getAsn();                  // int|null
    $result->isBlacklisted();           // bool
    $result->isTorExitNode();           // bool|null
}

阅读有关创建请求查询的更多信息。

理解和分析结果

您可能想知道给定的电子邮件地址/IP地址/用户名是否可以信任其在应用程序中执行操作。

请参阅webignition/sfs-result-analyser以获取帮助。

另请参阅

使用webignition/sfs-querier,其中包含webignition/sfs-result-analyserwebignition/sfs-client并提供详细的用法说明。