-
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecate setBaseUrl() and getArticleUrl() in favor of downloader.get…
…ArticleUrl()
- Loading branch information
1 parent
8ebd7d0
commit 3a5526e
Showing
11 changed files
with
41 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ | |
"test:e2e-coverage": "npm run test:pattern 'test/e2e' -- --coverage", | ||
"test:unit-coverage": "npm run test:pattern 'test/unit' -- --coverage", | ||
"test": "npm run test:unit-coverage -- --silent && npm run test:e2e-coverage -- --silent", | ||
"test:geturl": "npm start -- --mwUrl=https://en.wikipedia.org [email protected] --articleList=BMW", | ||
"test-verbose": "npm run test:unit-coverage && npm run test:e2e-coverage", | ||
"test-without-coverage": "npm run test:unit -- -- --silent && npm run test:e2e -- -- --silent", | ||
"codecov": "nyc --reporter=lcov npm t", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,10 @@ export function makeLink($doc: Document, href: string, rel: string, title: strin | |
export async function setupScrapeClasses({ mwUrl = 'https://en.wikipedia.org', format = '' } = {}) { | ||
MediaWiki.base = mwUrl | ||
|
||
const renderer = {} | ||
|
||
Object.defineProperty(renderer.constructor, 'name', { value: 'WikimediaDesktopRenderer' }) | ||
|
||
const downloader = new Downloader({ uaString: `${config.userAgent} ([email protected])`, speed: 1, reqTimeout: 1000 * 60, webp: false, optimisationCacheUrl: '' }) | ||
|
||
await MediaWiki.getMwMetaData(downloader) | ||
|
@@ -47,6 +51,7 @@ export async function setupScrapeClasses({ mwUrl = 'https://en.wikipedia.org', f | |
MediaWiki, | ||
downloader, | ||
dump, | ||
renderer, | ||
} | ||
} | ||
|
||
|