2017 © Pedro Peláez
 

library meta-scraper

Page meta scraper library

image

tomaj/meta-scraper

Page meta scraper library

  • Friday, May 18, 2018
  • by tomaj
  • Repository
  • 1 Watchers
  • 4 Stars
  • 7,010 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 8 Versions
  • 7 % Grown

The README.md

Meta Scraper

Build Status Code Climate Test Coverage, (*1)

SensioLabsInsight, (*2)

Page meta scraper parse meta information from page., (*3)

Installation

via composer:, (*4)

composer require tomaj/meta-scraper

How to use

Example:, (*5)

use Tomaj\Scraper\Scraper;
use Tomaj\Scraper\Parser\OgParser;

$scraper = new Scraper();
$parsers = [new OgParser()];
$meta = $scraper->parse(file_get_contents('http://www.google.com/'), $parsers);

var_dump($meta);

or you can use parseUrl method (internally use Guzzle library), (*6)

use Tomaj\Scraper\Scraper;
use Tomaj\Scraper\Parser\OgParser;

$scraper = new Scraper();
$parsers = [new OgParser()];
$meta = $scraper->parseUrl('http://www.google.com/', $parsers);

var_dump($meta);

Parsers

There are 3 parsers included in package and you can create new implementing interface Tomaj\Scraper\Parser\ParserInterface., (*7)

3 parsers: - Tomaj\Scraper\Parser\OgParser - based on og (Open Graph) meta attributes in html (built on regular expressions) - Tomaj\Scraper\Parser\OgDomParser - also based on og (Open Graph) meta attributes in html (built on php DOM extension) - Tomaj\Scraper\Parser\SchemaParser - based on schema json structure, (*8)

You can combine these parsers. Data that will not be found in first parser will be replaced with data from second parser., (*9)

use Tomaj\Scraper\Scraper;
use Tomaj\Scraper\Parser\SchemaParser;
use Tomaj\Scraper\Parser\OgParser;

$scraper = new Scraper();
$parsers = [new SchemaParser(), new OgParser()];
$meta = $scraper->parseUrl('http://www.google.com/', $parsers);

var_dump($meta);

The Versions

18/05 2018

1.5.0

1.5.0.0

Page meta scraper library

  Sources   Download

MIT

The Requires

 

The Development Requires

page meta sraper

18/05 2018

dev-master

9999999-dev

Page meta scraper library

  Sources   Download

MIT

The Requires

 

The Development Requires

page meta sraper

18/05 2018

1.4.0

1.4.0.0

Page meta scraper library

  Sources   Download

MIT

The Requires

 

The Development Requires

page meta sraper

23/01 2017

1.3.0

1.3.0.0

Page meta scraper library

  Sources   Download

MIT

The Requires

 

The Development Requires

page meta sraper

28/07 2016

1.2.1

1.2.1.0

Page meta scraper library

  Sources   Download

MIT

The Requires

 

The Development Requires

page meta sraper

28/07 2016

1.2.0

1.2.0.0

Page meta scraper library

  Sources   Download

MIT

The Requires

 

The Development Requires

page meta sraper

12/10 2015

1.1.0

1.1.0.0

Page meta scraper library

  Sources   Download

LGPL

The Requires

 

The Development Requires

page meta sraper

27/07 2015

1.0.0

1.0.0.0

Page meta scraper library

  Sources   Download

LGPL

The Requires

 

The Development Requires

page meta sraper