Commit Graph

9 Commits

Author SHA1 Message Date
Nick Sweeting
99062da034
Add --version CLI flag (#610)
* add --version CLI flag

* move import to top of file for consistency

Co-authored-by: John Holdun <john@johnholdun.com>
2022-05-09 08:37:10 -07:00
Michael Ashley
e12c916499
feat: ability to add custom extractors via api (#484)
* feat: ability to add custom extractors via api

* docs: updating readme

* fix: example.com was being used in another test

* fix: timezone was messing up date_published test

* fix: using a unique site for testing

* fix: updated custom extractor api

* docs: updating readme

* fix: removing unused fixture

* fix: updating test description

* feat: ability to add custom extractors via cli
2019-09-04 07:32:28 -07:00
Toufic Mouallem
144a797564
feat: Support passing custom headers in requests (#337) 2019-03-26 13:48:41 +02:00
Drew Bell
b3e2a0ffd1 feat: extract custom types with extend option (#313)
* feat: extract custom types with extend option

Adds an `extend` option that lets you add custom types to be extracted
and returned alongside the defaults, either in a call to `parse()` or in
a custom extractor.

```
Mercury.parse(
  url,
  extend: {
    last_edited: { selectors: ['#last-edited'], defaultCleaner: false }
  }
)
```

* chore: use Reflect.ownKeys

* feat: add CLI options

* doc: add extend param to cli help

* refactor: extract selectExtendedTypes

* feat: only overwrite null extended results

* feat: add allowMultiple extraction option

* feat: accept extendList CLI args

* feat: allow attribute selectors in extends on CLI

* test: update extend tests

* fix: don't invoke cleaner for custom types

* feat: always return array if allowMultiple

* test: add test for array of single result

* refactor: extract extractHtml

* refactor: destructure allowMultiple

* fix: wrap multiple matches in $ for cheerio shim

* fix: find extended types before any other munging

* feat: absolutize all links

* fix: clean content more directly

* doc: Update CLI docs in README

* chore: update dist

* doc: Document extend in custom extractor README
2019-03-25 15:36:20 -07:00
Adam Pash
e033835c72
fix: parse signature in cli (#259) 2019-02-07 17:03:42 -08:00
Adam Pash
9b0664bc91
feat: add content format output options (#256) 2019-02-07 16:48:13 -08:00
Adam Pash
b77a236dbe
feat: handle cli errors/timeout (#250) 2019-02-06 09:34:22 -08:00
Adam Pash
d884c3470c
release: 1.1.0 (#245) 2019-02-05 14:53:22 -08:00
Adam Pash
6844975c94
feat: add mercury-parser cli (#244) 2019-02-05 12:14:38 -08:00