anycomment/php-seo
Composer 安装命令:
composer require anycomment/php-seo
包简介
AnyComment SEO helps to server renders comments on the page.
README 文档
README
AnyComment SEO helps to server renders comments on the page.
It generates valid HTML and renders on the page for crawlers to index it.
Minimum requirement is PHP 5.6.
How It Works
- First of all, embed this library in your PHP project
- comments rendering code on the page where you would like to index comments
- the script will do the rest, it will take current page URL
- send requests to AnyComment API to pull latest comments
- generate valid HTML mark-up for these comments
- output it in
noscripttag which is not visible to the end user, but seen by crawlers
Internally, library uses cache. Initially it will make HTTP request to AnyComment API, next time it will get value from cache.
Installation
Add new package to composer.json in your project directory:
composer require anycomment/php-seo
or
{
"require":{
"anycomment/php-seo":"^0.1"
}
}
Examples
Examples can be found in /examples folder.
Notice that you need to provide your API key for each example to make it work.
Usage
You need to prepare a configuration class and pass your API key to constructor.
See example:
<?php include __DIR__ . '/../vendor/autoload.php'; use AnyComment\Seo\Comment; $seo = new Comment('YOU_API_KEY'); echo $seo->render('https://anycomment.io/demo');
统计信息
- 总下载量: 13
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2020-09-19