Repository navigation
Releases
Releases · tomaj/meta-scraper
4.3.0
Tagged on 2020-11-23.
Added
Tomaj\Scraper\Parser\OgDomParser: parses the same meta and Open Graph tags asOgParserwith the DOM extension instead of regular expressions (needsext-domandext-libxml) (#7).Meta::addAuthorByName()andMeta::addSectionByName().
Full Changelog: 4.2.0...4.3.0
4.2.0
Tagged on 2020-11-21.
Added
- Guzzle 7 support (
guzzlehttp/guzzle^6.0 | ^7.0). OgParserreads meta tags whose attributes use single quotes (#6).
Changed
- Autoloading switched from a classmap to PSR-4 (
Tomaj\Scraper\→src/).
Full Changelog: 4.1.0...4.2.0
4.1.0
4.0.0
Tagged on 2020-05-06.
Added
Scraper::__construct(array $guzzleOptions = [])passes options to the Guzzle client (merged with the defaults: 5 second connect timeout and theTomaj\ScraperUser-Agent) (#4).
Changed
- BREAKING CHANGE: the
$timeoutparameter ofScraper::parseUrl()was removed; passnew Scraper(['connect_timeout' => 10])instead. OgParseralso matches meta tags whosecontentattribute is not the last one.
Full Changelog: 3.0.0...4.0.0
3.0.0
Tagged on 2019-08-13.
Added
Tomaj\Scraper\AuthorandTomaj\Scraper\Sectionvalue objects withid()andname().SchemaParserreads sections (with their ids) fromarticleTermsentries of typeCategory;articleSectionis used whenarticleTermsis missing.
Changed
- BREAKING CHANGE:
Meta::addAuthor()takes anAuthorandMeta::addSection()takes aSection;getAuthors()/getSections()return these objects instead of arrays / strings. Replace$author['name']with$author->name()and$author['id']with$author->id().
Full Changelog: 2.0.1...3.0.0
2.0.1
2.0.0
Tagged on 2019-07-19.
Pluggable parsers: the scraper now combines the results of one or more parsers.
Added
Tomaj\Scraper\Parser\ParserInterfaceand two parsers:OgParser(meta and Open Graph tags) andSchemaParser(the JSON-LD<script id="schema" type="application/ld+json">block: headline, description, image, url, authors, sections, published/modified dates).Meta::merge(): values missing in the first parser's result are filled from the next parsers.- Multiple authors and sections:
Meta::addAuthor()/getAuthors()andMeta::addSection()/getSections()(#2).
Changed
- BREAKING CHANGE: PHP 7.1 or newer is required.
- BREAKING CHANGE:
Scraper::parse($content, array $parsers)andScraper::parseUrl($url, array $parsers, $timeout = 5)require the list of parsers to use; pass[new OgParser()]for the 1.x behaviour. - BREAKING CHANGE:
Meta::setAuthor()/getAuthor()andMeta::setSection()/getSection()were replaced byaddAuthor()/getAuthors()(each author is an array withidandname) andaddSection()/getSections(). - BREAKING CHANGE:
MetaandScrapermethods declare scalar parameter and return types (declare(strict_types=1)).
Full Changelog: 1.5.0...2.0.0
1.5.0
Tagged on 2018-05-18.
Changed
- Meta tags are parsed in one pass: every
<meta>tag is read once and itsnameorpropertyattribute (case-insensitive) is mapped to theMetafields, so attribute order no longer matters.
Full Changelog: 1.4.0...1.5.0
1.4.0
Tagged on 2018-05-18.
Changed
<title>tags with attributes and meta tags with additional attributes (e.g.<meta itemprop="..." name="description" content="...">) are now recognised.
Full Changelog: 1.3.0...1.4.0
1.3.0
Tagged on 2017-01-23.
Fixed
- An
article:published_time/article:modified_timevalue thatstrtotime()cannot parse is ignored instead of being stored as1970-01-01.
Full Changelog: 1.2.1...1.3.0