{"id":13570384,"url":"https://github.com/indieweb/php-mf2-shim","last_synced_at":"2026-01-02T02:02:13.631Z","repository":{"id":8479277,"uuid":"10081704","full_name":"indieweb/php-mf2-shim","owner":"indieweb","description":"A parsing library for parsing pages from a few common non-mf2 sites into the mf2 structure","archived":false,"fork":false,"pushed_at":"2016-05-31T10:50:50.000Z","size":204,"stargazers_count":14,"open_issues_count":4,"forks_count":4,"subscribers_count":23,"default_branch":"master","last_synced_at":"2024-10-29T19:02:29.280Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","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":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-05-15T15:17:21.000Z","updated_at":"2019-01-25T08:12:25.000Z","dependencies_parsed_at":"2022-09-19T22:05:17.365Z","dependency_job_id":null,"html_url":"https://github.com/indieweb/php-mf2-shim","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indieweb%2Fphp-mf2-shim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indieweb%2Fphp-mf2-shim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indieweb%2Fphp-mf2-shim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indieweb%2Fphp-mf2-shim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/indieweb","download_url":"https://codeload.github.com/indieweb/php-mf2-shim/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243646664,"owners_count":20324586,"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-08-01T14:00:51.826Z","updated_at":"2026-01-02T02:02:08.594Z","avatar_url":"https://github.com/indieweb.png","language":"HTML","funding_links":[],"categories":["HTML"],"sub_categories":[],"readme":"php-mf2-shim\n============\n\nAn extension for [php-mf2](https://github.com/indieweb/php-mf2) which screen-scrapes some sites which don’t support [microformats2](http://microformats.org/wiki/microformats2) into canonical microformats data structures to make them easy to consume.\n\nSupported sites:\n\n* **twitter.com** — tweets are parsed as h-entries with h-card authors, replies to tweets on permalink pages are parsed\n* **facebook.com** — post permalink pages are parsed as h-entries with h-card authors\n\nWork-in-progress:\n\n* instagram.com — no support right now\n\n## Installation\n\nInstall php-mf2-shim with Composer by adding \"mf2/shim\": \"0.2.*\" to the require object in your composer.json and running `php composer.phar update`.\n\nYou could install it by just downloading php-mf2, /Mf2/functions.php, /Mf2/Shim/*.php and including those, but please use Composer. Seriously, it’s amazing.\n\n## Usage\n\nmf2-shim is PSR-0 autoloadable, so all you have to do to load it is:\n\n* Include Composer’s auto-generated autoload file (/vendor/autoload.php)\n* Call Mf2\\Shim\\parseTwitter() or parseFacebook() with the HTML (or a DOMDocument), and optionally the URL to resolve relative URLs against.\n\n## Examples\n\n```php\n\u003c?php\n\nrequire 'vendor/autoload.php';\n\nuse Mf2;\n\n$output = Mf2\\Shim\\parseTwitter($html, $url);\n$output = Mf2\\Shim\\parseFacebook($html, $url);\n\n```\n\n## Changelog\n\n### v0.2.4\n\n* Improved pre-processing of in-tweet links, removing twitter gunk and t.co URLs for cleaner content.\n\n### v0.2.3\n* TODO: what happened in this update? It exists but the changelog wasn’t updated.\n\n### v0.2.2\n\n* Twitter parsing improved, now parses profile h-card and h-entries successfully from profile pages\n\n### v0.2.1\n\n* Added first draft of support for Facebook post permalink shimming\n\n### v0.2.0 (BREAKING)\n\n* Restructured things for consistency with php-mf2 v0.2.0\n* Removed dependencies, now only depends on php-mf2\n* Twitter parsing code tweet content is now an e-* dict containing html and value keys with raw and plaintext values, respectively\n\n### v0.1.0 (2013-06-07)\n\n* Initial tagged release\n* MIT Licenesed\n* Twitter tests passing, Instagram test failing\n* Tweet permalink page parsing working including authors and reply tweets\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findieweb%2Fphp-mf2-shim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Findieweb%2Fphp-mf2-shim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findieweb%2Fphp-mf2-shim/lists"}