mauricerenck/tratschtante

此包已被放弃,不再维护。作者建议使用 mauricerenck/indieconnector 包。

Kirby Webmentions 您的插件可以订阅的

安装: 14

依赖项: 0

建议者: 0

安全: 0

星标: 2

关注者: 1

分支: 0

类型:kirby-plugin

1.0.7 2021-11-17 08:33 UTC

README

已弃用

此插件将停止维护! 随着 Kirby 3.6 的发布,此插件将不再接收更新。请切换到 IndieConnector,它与该插件具有相同的基本功能,并且与该插件100%兼容。

GitHub release License Kirby Version

此插件目前仅与 webmention.io 兼容。

将 Tratschtante 终端添加到您的 webmention.io Webhooks,并输入您在 Kirby 配置中设置的回调密钥。

安装

  • composer require mauricerenck/tratschtante
  • 解压 master.zipsite/plugins/tratschtante
  • git submodule add https://github.com/mauricerenck/tratschtante.git site/plugins/tratschtante

配置

您必须在 config.php 中设置一个回调密钥

[
    'mauricerenck.tratschtante.secret' => 'my-secret',
]
  • 转到您的 webemention.io 账户并转到 Webhooks。
  • 输入 Tratschtante 终端:https://your-url.tld/tratschtante/webhook/webmentionio
  • 输入您在 config.php 中设置的回调密钥

使用方法

每当收到 webmention 时,Tratschtante 将触发一个您的插件可以订阅的 Kirby-Hook

'hooks' => [
    'tratschtante.webhook.received' => function ($webmention, $targetPage) {
        // $webmention: webmention data, see below
        // $targetPage: a kirby page object

        // YOUR CODE
    }
],

数据

Tratschtante 将处理一个包含一些数据的数组供您使用

[
'type' => STRING // one of the webmention.io types, see https://webmention.io/settings/webhooks,
'target' => 'target url',
'source' => 'source url',
'published' => 'publication date',
'author' => [
    'type' => 'card' or null,
    'name' => 'name' or null,
    'avatar' => 'avatar-url' or null,
    'url' => 'author url' or null,
],
'content' => 'comment text or empty string'
]

未来计划

  • 发送 webmention(已在其他地方实现,只需将其移动到这里即可)
  • 支持“原生”webmention,而不仅限于 webmention.io