diff options
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/esbuild.github.io.js | 20 | ||||
| -rw-r--r-- | examples/pkg.go.dev.js | 22 |
2 files changed, 0 insertions, 42 deletions
diff --git a/examples/esbuild.github.io.js b/examples/esbuild.github.io.js deleted file mode 100644 index 7839791..0000000 --- a/examples/esbuild.github.io.js +++ /dev/null @@ -1,20 +0,0 @@ -import { parse } from "flyscrape"; - -export const options = { - url: "https://esbuild.github.io/plugins/", - depth: 1, - rate: 100, - allowedDomains: [ - "esbuild.github.io", - "nodejs.org", - ], -} - -export default function({ html }) { - const doc = parse(html); - - return { - headline: doc('h1').text().trim(), - body: doc('main > p:nth-of-type(1)').text().trim(), - }; -} diff --git a/examples/pkg.go.dev.js b/examples/pkg.go.dev.js deleted file mode 100644 index 12aa308..0000000 --- a/examples/pkg.go.dev.js +++ /dev/null @@ -1,22 +0,0 @@ -import { parse } from "flyscrape"; - -export const options = { - url: "https://pkg.go.dev/github.com/stretchr/testify/require", -} - -export default function({ html }) { - const $ = parse(html); - - return { - package: $('h1').text().trim(), - meta: { - version: $('[data-test-id=UnitHeader-version] > a').text().replace("Version: ", "").trim(), - license: $('[data-test-id=UnitHeader-licenses] > a').text().trim(), - published: $('[data-test-id=UnitHeader-commitTime]').text().replace("Published: ", "").trim(), - imports: $('[data-test-id=UnitHeader-imports] > a').text().replace("Imports: ", "").trim(), - importedBy: $('[data-test-id=UnitHeader-importedby] > a').text().replace("Imported by: ", "").replace(/,/g,"").trim(), - }, - functions: $('.Documentation-indexList .Documentation-indexFunction > a').toArray().map(el => $(el).text()), - types: $('.Documentation-indexList .Documentation-indexType > a').toArray().map(el => $(el).text()), - }; -} |