Commit Graph

575 Commits (fix-remove-moment-js)
 

Author SHA1 Message Date
touchRED 9cf23f197b fix: update al.com timezone 1 year ago
touchRED c49b5efc7a fix: few more extractor updates 1 year ago
touchRED 3c336ef155 fix: add UTC timezone to extractors where needed 1 year ago
touchRED 8ad9309e3b fix: update some extractors to remove unnecessary timezones 1 year ago
touchRED 6a5f892c68 fix: update tests to remove dayjs where possible, update formats 1 year ago
touchRED 98b8f69d41 fix: replace moment with dayjs 1 year ago
connor trotter e8ba7ece29
fix: select extended types before content (#733) 1 year ago
connor trotter 2dd3ce6045
fix: update gif to match rebrand (#729) 1 year ago
Sarah Doire c0364ec52b
feat: update all fixtures and custom parsers to match (#713)
* feat: Refactor and update fixtures

This patch changes how fixtures are stored. Previously, a fixture's folder identified its domain and its filename identified when it was fetched. This has been changed so that the filename indicates the domain and the modified time of the file indicates how recently it was fetched. A fixture's filename can optionally include a modifier to distinguish between two different page types on the same domain, for example.

Also included here are changes to the update-fixture script, both to accomodate the new filename scheme as well as to actually update all fixtures. The functionality for running automatically and opening PRs has been removed but will likely be reintroduced.

Finally, all fixtures have been updated.

* Remove reference to deleted extractor

* feat: first batch of test and parser updates due to new fixtures

* feat: update more custom parsers and unit tests

* feat: update more custom parsers and unit tests and remove unnecessary parser

* feat: update more custom parsers and unit tests

* feat: update more parsers and add correct bloomberg html files

* fix: remove console statement

* feat: all parsers updated and tests passing

* fix: update date_published tests to account for test server time difference

* fix: cleanup remaining fixtures in folders

* feat: move fixtures for newest custom parsers

* feat: remove script changes

* fix: update dist files to account for reverting script changes

* adding .DS_Store to .gitignore

* adding .DS_Store to .gitignore -- 2

* adding .DS_Store to .gitignore -- 3 lol

* cleaning up some tests

* fix: ran build:generator command to update generate-custom-parser dist file

* fix: update rollup configs to generate source maps and update source maps

* fix: use underscore in place of unused error variable

* fix: remove unused fixture

Co-authored-by: Postlight Bot <adam.pash+postlight-bot@postlight.com>
Co-authored-by: flbn <overasc@gmail.com>
1 year ago
Sarah Doire 7b68bcd94c
feat: remove obsolete custom extractors (#712) 1 year ago
Andrei Zhemaituk 4981355628
fixed and improved extraction for latest layout of politico.com (#701)
* fixed and improved extraction for latest layout of politico.com

* explicit timezone for politico.com extractor

* handling more layout of politico.com

Co-authored-by: Andrei Zhemaituk <azhemoytuk@workfusion.com>
Co-authored-by: Sarah Doire <sarah.doire@postlight.com>
1 year ago
Andrei Zhemaituk 45bb28e217
custom parser for www.investmentexecutive.com (#700)
Co-authored-by: Andrei Zhemaituk <azhemoytuk@workfusion.com>
Co-authored-by: Sarah Doire <sarah.doire@postlight.com>
1 year ago
Andrei Zhemaituk 6532316973
custom parser for cbc.ca (#699)
Co-authored-by: Andrei Zhemaituk <azhemoytuk@workfusion.com>
Co-authored-by: Sarah Doire <sarah.doire@gmail.com>
Co-authored-by: Sarah Doire <sarah.doire@postlight.com>
1 year ago
Sarah Doire 6b4359d062
fix: postlight parser test (#710) 1 year ago
Austin 4c843be377
adjust postlight insights custom selectors (#707) 2 years ago
John Holdun ad8d4aa268
release: 2.2.3 (#703) 2 years ago
Austin 635fcf6356
fix: handle sec & ms timestamps properly (#702) 2 years ago
Michael Ashley ab401822aa
maintenance update - october 2022 (#696)
* fix: add alternative word count method

* fix: replace pages_rendered key with rendered_pages for consistency

* fix: return first lead_image_url when multiple og:image present

* fix: properly pull image src from lazy loaded img

* fix: allow drop cap character in medium custom extractor

* fix: refined medium parser
2 years ago
Sarah Doire 8ca8a5f7e5
feat: add postlight.com custom extractor (#695) 2 years ago
John Holdun 39b9ff55c4
release: 2.2.2 (#689) 2 years ago
John Holdun f1932e3672
Update README.md 2 years ago
John Holdun 97472cf4f8
Change Name (#688)
Mercury Parser is now Postlight Parser!
2 years ago
John Holdun eb9d0bc5e8
Update more dependencies (#687)
* Update more dependencies

Bumps almost everything up, removing almost all warnings from yarn audit. Doesn't touch cheerio or jest, as they require more attention and QA still.

* Adjust more dependencies, tweak build files
2 years ago
John Holdun 112846f74f
chore: Inline test fixtures (#683)
Not to be confused with extractor fixtures, which are snapshots of a webpage.

This change removes the pattern of separate JS files that provide "fixtures" for tests, which are used as provided or expected strings in tests. They were inconsistent and disorganized, and generally just served to add indirection to test files. So now all those strings are defined where they are used in their respective tests.
2 years ago
John Holdun 0d2bad544c chore: Update builds 2 years ago
Simon Reinhardt 035aa65dbc
Added custom extractor for www.spektrum.de (#677)
Co-authored-by: Simon Reinhardt <simon.reinhardt@hype.de>
Co-authored-by: John Holdun <john@johnholdun.com>
2 years ago
John Holdun f259d13753
feat: Add figcaption to list of non-convertible span parents (#682)
Based on this comment: https://github.com/postlight/mercury-parser/issues/530#issuecomment-580105171
2 years ago
Nate Weaver de314a9728
Add li to the list of non-convertible parents for spans (#531)
Co-authored-by: John Holdun <john@johnholdun.com>
2 years ago
John Brayton 9a961aa595
feat: Add a custom extractor for www.ndtv.com. (#554)
* feat:Add a custom extractor for ma.ttias.be.

When parsing content for cron.weekly issues, such as the one at https://ma.ttias.be/cronweekly/issue-130/, Mercury Parser would remove headings and ordered lists that were part of the content. This resolves that as follows:

* Remove "id" attributes from "h1" and "h2" elements. Those attributes would result in the elements having a low weight.
* Since Mercury Parser demotes "h1" elements to "h2", demote "h2" elements to "h3".
* Add class="entry-content-asset" to "ul" elements to avoid them being removed.

* removed redundant comment.

* feat: Add a custom extractor for engadget.com.

* feat: Add a custom extractor for www.ndtv.com.

* Works, but I need to figure how to make pagination work correctly.

* fixed pagination - would only retrieve first or second page because we would send contentOnly: true on subsequent pages (page 2).
removed failover: true from preview.

* rolled back { fallback: false } option removal

* Clarified comments.

* rolling back yarn.lock changes

Co-authored-by: John Holdun <john@johnholdun.com>
2 years ago
John Brayton 143631b4b7
feat: arstechnica.com extractor (#553)
* feat:Add a custom extractor for ma.ttias.be.

When parsing content for cron.weekly issues, such as the one at https://ma.ttias.be/cronweekly/issue-130/, Mercury Parser would remove headings and ordered lists that were part of the content. This resolves that as follows:

* Remove "id" attributes from "h1" and "h2" elements. Those attributes would result in the elements having a low weight.
* Since Mercury Parser demotes "h1" elements to "h2", demote "h2" elements to "h3".
* Add class="entry-content-asset" to "ul" elements to avoid them being removed.

* removed redundant comment.

* feat: Add a custom extractor for engadget.com.

* Works, but I need to figure how to make pagination work correctly.

* fixed pagination - would only retrieve first or second page because we would send contentOnly: true on subsequent pages (page 2).
removed failover: true from preview.

* rolled back { fallback: false } option removal

* Clarified comments.

Co-authored-by: John Holdun <john@johnholdun.com>
2 years ago
John Brayton 3c5c0bdba9
feat: Add a custom extractor for www.engadget.com. (#552)
* feat:Add a custom extractor for ma.ttias.be.

When parsing content for cron.weekly issues, such as the one at https://ma.ttias.be/cronweekly/issue-130/, Mercury Parser would remove headings and ordered lists that were part of the content. This resolves that as follows:

* Remove "id" attributes from "h1" and "h2" elements. Those attributes would result in the elements having a low weight.
* Since Mercury Parser demotes "h1" elements to "h2", demote "h2" elements to "h3".
* Add class="entry-content-asset" to "ul" elements to avoid them being removed.

* removed redundant comment.

* feat: Add a custom extractor for engadget.com.

Co-authored-by: John Holdun <john@johnholdun.com>
2 years ago
Sven Wiegand 13dfe720bd
Custom extractor for www.gruene.de (#485)
* Implemented custom extractor gruene.de

* Cleaner output of custom extracter www.gruene.de

* Updated fixture for www.gruene.de from real page

* Trying to pick image from og:image -- doesn't work ...

Co-authored-by: John Holdun <john@johnholdun.com>
2 years ago
dependabot[bot] 025261c120
chore(deps): Bump ws from 5.2.2 to 5.2.3 (#673)
Bumps [ws](https://github.com/websockets/ws) from 5.2.2 to 5.2.3.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/5.2.2...5.2.3)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2 years ago
dependabot[bot] 34bc6facc7
chore(deps): Bump moment from 2.29.2 to 2.29.4 (#672)
Bumps [moment](https://github.com/moment/moment) from 2.29.2 to 2.29.4.
- [Release notes](https://github.com/moment/moment/releases)
- [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/moment/moment/compare/2.29.2...2.29.4)

---
updated-dependencies:
- dependency-name: moment
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: John Holdun <john@johnholdun.com>
2 years ago
dependabot[bot] 7b15df58be
chore(deps): Bump terser from 4.8.0 to 4.8.1 (#671)
Bumps [terser](https://github.com/terser/terser) from 4.8.0 to 4.8.1.
- [Release notes](https://github.com/terser/terser/releases)
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/compare/v4.8.0...v4.8.1)

---
updated-dependencies:
- dependency-name: terser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: John Holdun <john@johnholdun.com>
2 years ago
John Holdun fb74196d79
chore: Update CircleCI config (#661)
Removing a couple extraneous CircleCI commands to see if they're still needed. I think one of the removed lines is causing #654 to fail, but let's see.
2 years ago
Jae Hanley f7439ec3fd
modifies check-build to differentiate between test env (#665)
Co-authored-by: John Holdun <john@johnholdun.com>
2 years ago
John Holdun 6ffa1a746e
chore: Update jQuery to 3.5.0 (#662)
Resolves #607
2 years ago
dependabot[bot] 8d18b0ed0d
chore(deps): Bump shell-quote from 1.6.1 to 1.7.3 (#668)
Bumps [shell-quote](https://github.com/substack/node-shell-quote) from 1.6.1 to 1.7.3.
- [Release notes](https://github.com/substack/node-shell-quote/releases)
- [Changelog](https://github.com/substack/node-shell-quote/blob/master/CHANGELOG.md)
- [Commits](https://github.com/substack/node-shell-quote/compare/1.6.1...1.7.3)

---
updated-dependencies:
- dependency-name: shell-quote
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2 years ago
Samuel Clay d5dabae20b
Update CHANGELOG.md (#663)
Typo on v2.2.1 release date
2 years ago
Jim Nielsen 9cd9662bcb
support build of es modules (#570) 2 years ago
Marco Wiedemeyer d0c78911e6
Add a new custom extractor for www.abendblatt.de (#559)
* Add custom extractor for www.abendblatt.de

* update

Co-authored-by: Marco Wiedemeyer <marco.wiedemeyer@ottogroup.com>
Co-authored-by: John Holdun <john@johnholdun.com>
2 years ago
Felipe Canejo 6014016283
feat: Add a custom extractor for pastebin.com (#556)
* feat: Add a custom extractor for pastebin.com

* feat: transforms <li> to <p> in pastebin.com

Co-authored-by: Felipe Canejo <felipecanejo@gmail.com>
Co-authored-by: John Holdun <john@johnholdun.com>
2 years ago
John Brayton e217648c0b
feat: ma.ttias.be extractor (#551)
* feat:Add a custom extractor for ma.ttias.be.

When parsing content for cron.weekly issues, such as the one at https://ma.ttias.be/cronweekly/issue-130/, Mercury Parser would remove headings and ordered lists that were part of the content. This resolves that as follows:

* Remove "id" attributes from "h1" and "h2" elements. Those attributes would result in the elements having a low weight.
* Since Mercury Parser demotes "h1" elements to "h2", demote "h2" elements to "h3".
* Add class="entry-content-asset" to "ul" elements to avoid them being removed.

* removed redundant comment.

Co-authored-by: John Holdun <john@johnholdun.com>
2 years ago
James Shakespeare 70e99d56cf
Feat: update qz.com selectors and tests (#538)
* feat: update qz.com selectors and tests

* chore: remove out of date fixture
2 years ago
Michael Ashley 56a19bf934
fix: updating generate-parser dist (#499) 2 years ago
Ethan Jucovy af9cfcd120
fix: don't try to re-decode prepared response (#498)
* fix: don't try to re-decode prepared response

* Remove stray console.log
2 years ago
Peter Dave Hello 9515dc28c1
chore: update node version in .nvmrc & CONTRIBUTING.md (#599)
Ref: #579, a5a066c69d
2 years ago
Joe Moon fb44ab0244
Bugfix new yorker wired extractors (#604)
* www.newyorker.com: add updated fixtures and fix extractors

* www.wired.com: add updated fixtures and fix extractors

Co-authored-by: John Holdun <john@johnholdun.com>
2 years ago
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>
2 years ago