Skip to content

πŸ“œ Extract meaningful content from the chaos of a web page

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

postlight/parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

86d6bd1 Β· Mar 24, 2017
Mar 24, 2017
Mar 24, 2017
Mar 10, 2017
Mar 24, 2017
Sep 16, 2016
Oct 26, 2016
Oct 28, 2016
Nov 21, 2016
Oct 28, 2016
Jan 27, 2017
Nov 29, 2016
Mar 24, 2017
Sep 20, 2016
Oct 28, 2016
Oct 28, 2016
Dec 1, 2016
Nov 21, 2016
Mar 24, 2017
Dec 1, 2016
Nov 29, 2016
Nov 29, 2016
Sep 13, 2016
Mar 15, 2017

Repository files navigation

Mercury Parser - Extracting content from chaos

CircleCI Build status

The Mercury Parser extracts the bits that humans care about from any URL you give it. That includes article content, titles, authors, published dates, excerpts, lead images, and more.

The Mercury Parser module powers the Mercury Parser API, a free API from Postlight that puts all of this information one API request away..

How? Like this.

import Mercury from 'mercury-parser';

Mercury.parse(url).then(result => console.log(result););

The result looks like this:

{
  "title": "Thunder (mascot)",
  "content": "<div><div><p>This is the content of the page!</div></div>",
  "author": "Wikipedia Contributors",
  "date_published": "2016-09-16T20:56:00.000Z",
  "lead_image_url": null,
  "dek": null,
  "next_page_url": null,
  "url": "https://en.wikipedia.org/wiki/Thunder_(mascot)",
  "domain": "en.wikipedia.org",
  "excerpt": "Thunder Thunder is the stage name for the horse who is the official live animal mascot for the Denver Broncos",
  "word_count": 4677,
  "direction": "ltr",
  "total_pages": 1,
  "rendered_pages": 1
}

If Mercury is unable to find a field, that field will return null.

Contributing

If you'd like to write a custom parser for a site, here's how.

Contributors

All Contributors


Adam Pash

πŸ“ πŸ’» πŸ“– πŸ’‘

Toy Vano

πŸ’»

Drew Bell

πŸ’»

Jeremy Mack

πŸ’»