indieweb/representative-h-card
最新稳定版本:0.1.3
Composer 安装命令:
composer require indieweb/representative-h-card
包简介
README 文档
README
Given a parsed mf2 document, return the representative h-card for the page.
Installation
Install via composer:
{
"indieweb/representative-h-card": "0.1.*"
}
Or just require the one file:
require_once('src/mf2/representative-h-card.php');
Usage
This function accepts a PHP array in the format returned by the microformats2 parser.
$url = 'http://aaronparecki.com/'; $html = file_get_contents($url); $parsed = Mf2\parse($html, $url); $representative = Mf2\HCard\representative($parsed, $url); print_r($representative);
The function will find the representative h-card (according to the representative h-card parsing rules) and will return the h-card that is found.
Array
(
[type] => Array
(
[0] => h-card
)
[properties] => Array
(
[name] => Array
(
[0] => Aaron Parecki
)
[photo] => Array
(
[0] => http://aaronparecki.com/images/aaronpk.png
)
[url] => Array
(
[0] => http://aaronparecki.com/
)
[uid] => Array
(
[0] => http://aaronparecki.com/
)
)
)
统计信息
- 总下载量: 23.72k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 16
- 点击次数: 0
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2015-12-23