Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

if <script> with 'mw.config.set' is not found then grab <script> with config variables #1766

Merged
merged 2 commits into from
Feb 18, 2023

Conversation

pavel-karatsiuba
Copy link
Contributor

@pavel-karatsiuba pavel-karatsiuba commented Feb 3, 2023

Scraper takes article configuration from <script> tag of HTML page.
Right now API is not provided such configuration.
With this PR the configuration takes in another way.
Fixes #1662

@codecov
Copy link

codecov bot commented Feb 3, 2023

Codecov Report

Base: 69.64% // Head: 69.51% // Decreases project coverage by -0.14% ⚠️

Coverage data is based on head (2120fe7) compared to base (89abe74).
Patch coverage: 75.00% of modified lines in pull request are covered.

❗ Current head 2120fe7 differs from pull request most recent head 061b04e. Consider uploading reports for the commit 061b04e to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1766      +/-   ##
==========================================
- Coverage   69.64%   69.51%   -0.14%     
==========================================
  Files          23       23              
  Lines        2583     2585       +2     
  Branches      590      591       +1     
==========================================
- Hits         1799     1797       -2     
- Misses        674      675       +1     
- Partials      110      113       +3     
Impacted Files Coverage Δ
src/util/saveArticles.ts 80.99% <75.00%> (+0.78%) ⬆️
src/MediaWiki.ts 78.28% <0.00%> (-3.29%) ⬇️
src/Dump.ts 81.18% <0.00%> (-1.00%) ⬇️
src/util/misc.ts 72.09% <0.00%> (-0.94%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@kelson42 kelson42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we not die if nothing is detected, so no jsConfigVars? Should we not build an automated test for this?

@pavel-karatsiuba
Copy link
Contributor Author

Should we not die if nothing is detected, so no jsConfigVars? Should we not build an automated test for this?

I have added an automated test to show which data we are getting. Empty data is not a problem because we are taking these data from the source page and we assume that the source page has the right format.

@kelson42 kelson42 merged commit 5357f13 into main Feb 18, 2023
@kelson42 kelson42 deleted the use-js-config-variables branch February 18, 2023 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

site.js should be loaded last to avoid "Cannot read properties of undefined (reading 'getParamValue')"
2 participants