Skip to content

2.0.0

Compare
Choose a tag to compare
@Kikobeats Kikobeats released this 11 Dec 13:37
· 1802 commits to master since this release
3a81306

Breaking Changes

From now, metascraper will be the main method and you need to pass html and url for extracting metadata.

const metascraper = require('metascraper')
const got = require('got')

const targetUrl = 'http://www.bloomberg.com/news/articles/2016-05-24/as-zenefits-stumbles-gusto-goes-head-on-by-selling-insurance'

;(async () => {
  const {body: html, url} = await got(targetUrl)
  const metadata = await metascraper({html, url})
  console.log(metadata)
})()

We moved the HTTP layout out of the library to avoid problems related to the connections.

Also in this new interface rules are not exposed directly.

Features

logo data field

We added a new field logo for identifying the publisher brand under a link. It uses the high resolution favicon possible to get as a fallback.

Improvements

Codebase simplification

We rewrote the code to make easy support plugins in the future.

Testing environment

We updated integration tests, with at least top50 popular internet sites. Also, they are automated, so add a new test is easy.