{"id":21191725,"url":"https://github.com/indieweb/representative-h-card-php","last_synced_at":"2025-07-10T03:31:02.110Z","repository":{"id":56990887,"uuid":"48499978","full_name":"indieweb/representative-h-card-php","owner":"indieweb","description":"Given a parsed mf2 document, return the representative h-card for the page","archived":false,"fork":false,"pushed_at":"2023-05-24T15:35:31.000Z","size":24,"stargazers_count":15,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-29T19:00:32.026Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://microformats.org/wiki/representative-h-card-parsing","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/indieweb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2015-12-23T16:22:42.000Z","updated_at":"2024-06-19T18:40:58.000Z","dependencies_parsed_at":"2022-08-21T10:10:19.609Z","dependency_job_id":null,"html_url":"https://github.com/indieweb/representative-h-card-php","commit_stats":{"total_commits":13,"total_committers":2,"mean_commits":6.5,"dds":"0.23076923076923073","last_synced_commit":"97731c6ccc0838418c775b867bf826aeaa91cd95"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indieweb%2Frepresentative-h-card-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indieweb%2Frepresentative-h-card-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indieweb%2Frepresentative-h-card-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indieweb%2Frepresentative-h-card-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/indieweb","download_url":"https://codeload.github.com/indieweb/representative-h-card-php/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225615187,"owners_count":17496945,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-20T19:04:41.371Z","updated_at":"2024-11-20T19:04:41.982Z","avatar_url":"https://github.com/indieweb.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Representative H-Card Parsing\n=============================\n\n[![Build Status](https://travis-ci.org/indieweb/representative-h-card-php.png?branch=master)](http://travis-ci.org/indieweb/representative-h-card-php)\n[![Packagist](https://img.shields.io/packagist/v/indieweb/representative-h-card.svg)](https://packagist.org/packages/indieweb/representative-h-card)\n\nGiven a parsed mf2 document, return the [representative h-card](http://microformats.org/wiki/representative-h-card-parsing) for the page.\n\n\nInstallation\n------------\n\nInstall via composer:\n\n```json\n{\n  \"indieweb/representative-h-card\": \"0.1.*\"\n}\n```\n\nOr just require the one file:\n\n```php\nrequire_once('src/mf2/representative-h-card.php');\n```\n\nUsage\n-----\n\nThis function accepts a PHP array in the format returned by the [microformats2 parser](https://github.com/indieweb/php-mf2).\n\n```php\n$url = 'http://aaronparecki.com/';\n$html = file_get_contents($url);\n$parsed = Mf2\\parse($html, $url);\n$representative = Mf2\\HCard\\representative($parsed, $url);\nprint_r($representative);\n```\n\nThe 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\nreturn the h-card that is found.\n\n```\nArray\n(\n    [type] =\u003e Array\n        (\n            [0] =\u003e h-card\n        )\n    [properties] =\u003e Array\n        (\n            [name] =\u003e Array\n                (\n                    [0] =\u003e Aaron Parecki\n                )\n            [photo] =\u003e Array\n                (\n                    [0] =\u003e http://aaronparecki.com/images/aaronpk.png\n                )\n            [url] =\u003e Array\n                (\n                    [0] =\u003e http://aaronparecki.com/\n                )\n            [uid] =\u003e Array\n                (\n                    [0] =\u003e http://aaronparecki.com/\n                )\n        )\n)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findieweb%2Frepresentative-h-card-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Findieweb%2Frepresentative-h-card-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findieweb%2Frepresentative-h-card-php/lists"}