dev-master
9999999-dev http://www.pagemunch.comA PHP wrapper for the PageMunch link unfurling API
MIT
The Requires
- php >=5.3.0
by Tom Moor
url json link web crawler metadata schema.org parsing microformats unfurling
A PHP wrapper for the PageMunch link unfurling API
PageMunch is a simple API backed by an intelligent web crawler, that lets you extract data from any webpage on the internet in milliseconds. Whether you want to grab the best title, description and image for a page, prices, authorship, enable video embeds or more. We make it crazy easy to treat the web like a database., (*1)
You can install the PHP module using Composer, simply add it to your requirements, for example:, (*2)
{ "require": { "PageMunch/PageMunch": ">=1.0.0" } }
Or clone the repository directly from GitHub and use the class in the vendors directory of your Framework or elsewhere., (*3)
// if using Composer then you should use an autoloader, otherwise require the // file however you might normally require('src/PageMunch/PageMunch.php'); use PageMunch\PageMunch; // create a new API object to use for requests - your API key from the PageMunch // account dashboard should be passed in here. We recommend using an environment // variable to make distributing code between environments easier and more secure $api = new PageMunch(array('key' => getenv('PAGEMUNCH_API_KEY'))); $response = $api->extract('http://www.youtube.com/watch?v=9bZkp7q19f0'); // check if the API call succeeded and output the title from the response data if ($response) { print_r($response->title); } else { print_r($api->getError()->message); }
For more information, libraries and documentation check out the PageMunch Documentation, (*4)
This module is Copyright PageMunch 2017., (*5)
A PHP wrapper for the PageMunch link unfurling API
MIT
url json link web crawler metadata schema.org parsing microformats unfurling