2017 © Pedro Peláez
 

library representative-h-card

image

indieweb/representative-h-card

  • Friday, April 15, 2016
  • by aaronpk
  • Repository
  • 1 Watchers
  • 8 Stars
  • 386 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 4 Versions
  • 26 % Grown

The README.md

Representative H-Card Parsing

Build Status Packagist, (*1)

Given a parsed mf2 document, return the representative h-card for the page., (*2)

Installation

Install via composer:, (*3)

{
  "indieweb/representative-h-card": "0.1.*"
}

Or just require the one file:, (*4)

require_once('src/mf2/representative-h-card.php');

Usage

This function accepts a PHP array in the format returned by the microformats2 parser., (*5)

$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., (*6)

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/
                )
        )
)

The Versions

15/04 2016

dev-master

9999999-dev

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4

 

The Development Requires

indieweb microformats h-card mf2

23/12 2015

0.1.2

0.1.2.0

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4

 

The Development Requires

indieweb microformats h-card mf2

23/12 2015

0.1.1

0.1.1.0

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4

 

The Development Requires

indieweb microformats h-card mf2

23/12 2015

0.1.0

0.1.0.0

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4

 

The Development Requires

indieweb microformats h-card mf2