Skip to content

Latest commit

 

History

History
38 lines (25 loc) · 1012 Bytes

README.md

File metadata and controls

38 lines (25 loc) · 1012 Bytes

Mercury

A simple wrapper for the Mercury Web Parser API, powered by HTTPoison.

Installation

If available in Hex, the package can be installed as:

  1. Add mercury to your list of dependencies in mix.exs:
def deps do
  [
    {:mercury, "~> 0.1.1"},
  ]
end
  1. Add your Mercury API key to your config.exs
config :mercury, api_key: "<your_mercury_api_key>"

If you don't already have one, you can sign up for a Mercury Parser API key here.

Usage

To fetch the content for an article, run:

{:ok, response} = Mercury.parse("https://trackchanges.postlight.com/extracting-content-from-the-chaos-of-the-web-introducing-the-mercury-web-parser-e920a1db7f86")

# -- OR --

%{body: body} = Mercury.parse!("https://trackchanges.postlight.com/extracting-content-from-the-chaos-of-the-web-introducing-the-mercury-web-parser-e920a1db7f86")