Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/indieweb/php-mf2-shim
A parsing library for parsing pages from a few common non-mf2 sites into the mf2 structure
https://github.com/indieweb/php-mf2-shim
Last synced: 9 days ago
JSON representation
A parsing library for parsing pages from a few common non-mf2 sites into the mf2 structure
- Host: GitHub
- URL: https://github.com/indieweb/php-mf2-shim
- Owner: indieweb
- License: other
- Created: 2013-05-15T15:17:21.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2016-05-31T10:50:50.000Z (over 8 years ago)
- Last Synced: 2024-10-29T19:02:29.280Z (15 days ago)
- Language: HTML
- Size: 199 KB
- Stars: 14
- Watchers: 23
- Forks: 4
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
php-mf2-shim
============An 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.
Supported sites:
* **twitter.com** — tweets are parsed as h-entries with h-card authors, replies to tweets on permalink pages are parsed
* **facebook.com** — post permalink pages are parsed as h-entries with h-card authorsWork-in-progress:
* instagram.com — no support right now
## Installation
Install 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`.
You 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.
## Usage
mf2-shim is PSR-0 autoloadable, so all you have to do to load it is:
* Include Composer’s auto-generated autoload file (/vendor/autoload.php)
* Call Mf2\Shim\parseTwitter() or parseFacebook() with the HTML (or a DOMDocument), and optionally the URL to resolve relative URLs against.## Examples
```php