Skip to content

Commit

Permalink
chore: Fix references to Postlight Parser in README
Browse files Browse the repository at this point in the history
  • Loading branch information
jocmp committed Jan 15, 2025
1 parent dc5bd15 commit 6abdf5a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 256 deletions.
230 changes: 0 additions & 230 deletions CONTRIBUTING.md

This file was deleted.

14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,25 +113,25 @@ yarn global add @jocmp/mercury-parser
npm -g install @jocmp/mercury-parser

# Then
postlight-parser https://postlight.com/trackchanges/mercury-goes-open-source
mercury-parser https://postlight.com/trackchanges/mercury-goes-open-source

# Pass optional --format argument to set content type (html|markdown|text)
postlight-parser https://postlight.com/trackchanges/mercury-goes-open-source --format=markdown
mercury-parser https://postlight.com/trackchanges/mercury-goes-open-source --format=markdown

# Pass optional --header.name=value arguments to include custom headers in the request
postlight-parser https://postlight.com/trackchanges/mercury-goes-open-source --header.Cookie="name=value; name2=value2; name3=value3" --header.User-Agent="Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1"
mercury-parser https://postlight.com/trackchanges/mercury-goes-open-source --header.Cookie="name=value; name2=value2; name3=value3" --header.User-Agent="Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1"

# Pass optional --extend argument to add a custom type to the response
postlight-parser https://postlight.com/trackchanges/mercury-goes-open-source --extend credit="p:last-child em"
mercury-parser https://postlight.com/trackchanges/mercury-goes-open-source --extend credit="p:last-child em"

# Pass optional --extend-list argument to add a custom type with multiple matches
postlight-parser https://postlight.com/trackchanges/mercury-goes-open-source --extend-list categories=".meta__tags-list a"
mercury-parser https://postlight.com/trackchanges/mercury-goes-open-source --extend-list categories=".meta__tags-list a"

# Get the value of attributes by adding a pipe to --extend or --extend-list
postlight-parser https://postlight.com/trackchanges/mercury-goes-open-source --extend-list links=".body a|href"
mercury-parser https://postlight.com/trackchanges/mercury-goes-open-source --extend-list links=".body a|href"

# Pass optional --add-extractor argument to add a custom extractor at runtime.
postlight-parser https://postlight.com/trackchanges/mercury-goes-open-source --add-extractor ./src/extractors/fixtures/postlight.com/index.js
mercury-parser https://postlight.com/trackchanges/mercury-goes-open-source --add-extractor ./src/extractors/fixtures/postlight.com/index.js
```

## License
Expand Down
6 changes: 3 additions & 3 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ const {
if (!urlToParse) {
console.log(
'\n\
postlight-parser\n\n\
The Postlight Parser extracts semantic content from any url\n\n\
mercury-parser\n\n\
Mercury Parser extracts semantic content from any url\n\n\
Usage:\n\
\n\
$ postlight-parser url-to-parse [--format=html|text|markdown] [--header.name=value]... [--extend type=selector]... [--extend-list type=selector]... [--add-extractor path_to_extractor.js]... \n\
$ mercury-parser url-to-parse [--format=html|text|markdown] [--header.name=value]... [--extend type=selector]... [--extend-list type=selector]... [--add-extractor path_to_extractor.js]... \n\
\n\
'
);
Expand Down
8 changes: 4 additions & 4 deletions src/extractors/custom/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Custom Parsers

Postlight Parser can extract meaningful content from almost any web site, but custom parsers/extractors allow the Postlight Parser to find the content more quickly and more accurately than it might otherwise do. Our goal is to include custom parsers as many sites as we can, and we'd love your help!
Postlight Parser can extract meaningful content from almost any web site, but custom parsers/extractors allow Mercury Parser to find the content more quickly and more accurately than it might otherwise do. Our goal is to include custom parsers as many sites as we can, and we'd love your help!

## The basics of parsing a site with a custom parser

Custom parsers allow you to write CSS selectors that will find the content you're looking for on the page you're testing against. If you've written any CSS or jQuery, CSS selectors should be very familiar to you.

You can query for every field returned by the Postlight Parser:
You can query for every field returned by Mercury Parser:

- `title`
- `author`
Expand Down Expand Up @@ -195,7 +195,7 @@ Now that you know the basics of how custom extractors work, let's walk through t
### Step 0: Installation
First, you'll need to clone the Postlight Parser repository and install dependencies.
First, you'll need to clone Mercury Parser repository and install dependencies.
```bash
git clone git@github.com:postlight/parser.git
Expand Down Expand Up @@ -404,5 +404,5 @@ module.exports = customExtractor;
### 2. From the CLI, add the `--add-extractor` param:
```bash
postlight-parser https://postlight.com/trackchanges/mercury-goes-open-source --add-extractor ./src/extractors/fixtures/postlight.com/index.js
mercury-parser https://postlight.com/trackchanges/mercury-goes-open-source --add-extractor ./src/extractors/fixtures/postlight.com/index.js
```
12 changes: 0 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -820,14 +820,6 @@
dependencies:
"@octokit/openapi-types" "^22.2.0"

"@postlight/ci-failed-test-reporter@^1.0":
version "1.0.26"
resolved "https://registry.yarnpkg.com/@postlight/ci-failed-test-reporter/-/ci-failed-test-reporter-1.0.26.tgz#dbb8a07bf2e500476dc6bac0611aac2c8fbbe567"
integrity sha512-xfXzxyOiKhco7Gx2OLTe9b66b0dFJw0elg94KGHoQXf5F8JqqFvdo35J8wayGOor64CSMvn+4Bjlu2NKV+yTGA==
dependencies:
dotenv "^6.2.0"
node-fetch "^2.3.0"

"@postman/form-data@~3.1.1":
version "3.1.1"
resolved "https://registry.yarnpkg.com/@postman/form-data/-/form-data-3.1.1.tgz#d0446d0d3639a291f5e800e89fa1d0d3723f9414"
Expand Down Expand Up @@ -3122,10 +3114,6 @@ [email protected], domutils@^1.5.1:
dom-serializer "0"
domelementtype "1"

dotenv@^6.2.0:
version "6.2.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-6.2.0.tgz#941c0410535d942c8becf28d3f357dbd9d476064"

dunder-proto@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/dunder-proto/-/dunder-proto-1.0.0.tgz#c2fce098b3c8f8899554905f4377b6d85dabaa80"
Expand Down

0 comments on commit 6abdf5a

Please sign in to comment.