xiaodi/think-site-pusher

ThinkPHP 网站链接提交 扩展包

Installs: 107

Dependents: 0

Suggesters: 0

Security: 0

Stars: 13

Watchers: 2

Forks: 4

Type:think-extend

v1.0.1 2020-10-02 00:20 UTC

This package is auto-updated.

Last update: 2024-04-29 04:26:56 UTC


README

ThinkPHP 扩展包 网站链接提交

Latest Stable Version Total Downloads Latest Unstable Version

安装

composer require xiaodi/think-site-pusher

配置

默认配置

项目根目录 config/push.php

临时配置

use EasyPush\Facade\Pusher;

$config = ['site' => 'xxx', 'token' => 'xxx'];
Pusher::baidu($config)->urls($urls);

使用

Facade

use EasyPush\Facade\Pusher;

$urls = [
  'https://www.xiaodim.com/index.html',
  'https://www.xiaodim.com/2019/10/25/thinkphp6-rpc-tutorial/'
]

// 推送链接
Pusher::baidu()->push($urls);

// 更新链接
Pusher::baidu()->update($urls);

// 删除链接
Pusher::baidu()->delete($urls);

助手函数

$urls = [
  'https://www.xiaodim.com/index.html',
  'https://www.xiaodim.com/2019/10/25/thinkphp6-rpc-tutorial/'
]

// 推送链接
app('pusher')->baidu()->push($url);

// 更新链接
app('pusher')->baidu()->update($urls);

// 删除链接
app('pusher')->baidu()->delete($urls);