PHPackages                             indieweb/representative-h-card - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. indieweb/representative-h-card

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

indieweb/representative-h-card
==============================

0.1.3(3y ago)1624.9k↓35.7%1[1 issues](https://github.com/indieweb/representative-h-card-php/issues)2Apache-2.0PHPPHP &gt;=5.4

Since Dec 23Pushed 3y ago1 watchersCompare

[ Source](https://github.com/indieweb/representative-h-card-php)[ Packagist](https://packagist.org/packages/indieweb/representative-h-card)[ RSS](/packages/indieweb-representative-h-card/feed)WikiDiscussions main Synced yesterday

READMEChangelog (1)Dependencies (2)Versions (5)Used By (2)

Representative H-Card Parsing
=============================

[](#representative-h-card-parsing)

[![Build Status](https://camo.githubusercontent.com/e205526550203fd48f3890b6dcf73abbe4cd8ad12fa9a630f3319008a3674427/68747470733a2f2f7472617669732d63692e6f72672f696e6469657765622f726570726573656e7461746976652d682d636172642d7068702e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/indieweb/representative-h-card-php)[![Packagist](https://camo.githubusercontent.com/fcc0ef7f0c4a03381b45ef01557684e8d73cf30a071ce7a758d990bb6e4c0163/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696e6469657765622f726570726573656e7461746976652d682d636172642e737667)](https://packagist.org/packages/indieweb/representative-h-card)

Given a parsed mf2 document, return the [representative h-card](http://microformats.org/wiki/representative-h-card-parsing) for the page.

Installation
------------

[](#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
-----

[](#usage)

This function accepts a PHP array in the format returned by the [microformats2 parser](https://github.com/indieweb/php-mf2).

```
$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](http://microformats.org/wiki/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/
                )
        )
)

```

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~903 days

Total

4

Last Release

1136d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/385b302aef27e9e72ddfbf65c8b15cfce5946744fe2e541c5b415665fc2351fc?d=identicon)[aaronpk](/maintainers/aaronpk)

---

Top Contributors

[![aaronpk](https://avatars.githubusercontent.com/u/113001?v=4)](https://github.com/aaronpk "aaronpk (13 commits)")[![martymcguire](https://avatars.githubusercontent.com/u/14772?v=4)](https://github.com/martymcguire "martymcguire (3 commits)")

---

Tags

microformatsindiewebh-cardmf2

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/indieweb-representative-h-card/health.svg)

```
[![Health](https://phpackages.com/badges/indieweb-representative-h-card/health.svg)](https://phpackages.com/packages/indieweb-representative-h-card)
```

###  Alternatives

[indieweb/date-formatter

Render dates and date ranges in a human-readable format, including proper microformats-2 markup

1919.8k](/packages/indieweb-date-formatter)[tritum/repeatable-form-elements

Adds a new form element which allows the editor to create new container elements with any type fields in them. In the frontend, a user can create any number of new containers. This is an extension for TYPO3 CMS.

16111.0k](/packages/tritum-repeatable-form-elements)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
