robertlemke/akismet

Akismet 智能评论垃圾邮件检测器与 Flow 的集成

v3.1.2 2023-11-01 09:00 UTC

This package is auto-updated.

Last update: 2024-08-30 01:25:56 UTC


README

提供方便访问 Akismet REST 服务的 Flow 包。

设置

为了使用该服务,您首先需要在 http://akismet.com/ (通常是免费的)注册一个账户。

接下来,只需将此包添加到您的应用中,通过将其添加到 composer.json 文件中所需的包即可。

最后,将您的 Akismet 凭据添加到 Settings.yaml 中

RobertLemke:
  Akismet:

    # Defines the host of the Akismet service. Does not have to be changed unless
    # Akismet changes its service entry point.
    serviceHost: 'rest.akismet.com'

    # The API key you have been provided by Akismet
    apiKey: ''

    # The frontpage URI pointing to your blog or the site using Akismet. Must be
    # a full URI, for example "http://robertlemke.com/blog".
    blogUri: ''

使用方法

Service 类提供了一个简单的 API,用于检查评论是否为垃圾邮件或向服务提交新的垃圾邮件或正常邮件。

$isSpam = $service->isCommentSpam($permaLink, $content, $type, $author, $authorEmailAddress, $authorUri);