-
Notifications
You must be signed in to change notification settings - Fork 11
feat: Remake the Scraper in TS. -- Does not touch the UI. #89
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
base: master
Are you sure you want to change the base?
feat: Remake the Scraper in TS. -- Does not touch the UI. #89
Conversation
…MrFrick/dbs-scraper into feature/Remake-to-TS-Version
Xotl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @TheMrFrick... Thanks a lot for your contribution.
I would like to merge this but seems that there're lots of files that ends on a Windows style. Can you please change those in order to end with a new line. Here's some context of the importance on doing so: https://stackoverflow.com/a/729795
| cardPrices.json_* | ||
| *.xlsx | ||
| reworkedCards.json | ||
| reworkedCards.json_* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| reworkedCards.json_* | |
| reworkedCards.json_* | |
| { | ||
| "docwriter.progress.trackFunctions": false, | ||
| "docwriter.progress.trackMethods": false | ||
| } No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } | |
| } | |
| } | ||
|
|
||
| return result; | ||
| } No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } | |
| } | |
| era: find('dl.eraCol dd').text().trim(), | ||
| cardImageUrl: getImageUrl(find('.cardimg > img')).trim(), | ||
| }; | ||
| } No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } | |
| } | |
| function extractCategoryFromHref(hrefString: string): string | undefined { | ||
| const match = hrefString.match(HREF_REGEXP); | ||
| return match?.groups?.category; | ||
| } No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } | |
| } | |
|
|
||
| } | ||
| console.log('programming is running'); | ||
| main(); No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| main(); | |
| main(); | |
| // console.log(cards); | ||
| console.log(`${cards.length} cards found!`) | ||
| } | ||
| testCardScraper(); No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| testCardScraper(); | |
| testCardScraper(); | |
| writeFileSync(DEFAULT_OUTPUT, JSON.stringify({...(cardListJSON as any)})); | ||
| } | ||
|
|
||
| main(); No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| main(); | |
| main(); | |
| } | ||
| } | ||
|
|
||
| main(); No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| main(); | |
| main(); | |
| } | ||
|
|
||
| // promptUser('test'); | ||
| main(); No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| main(); | |
| main(); | |
What's the purpose of this PR?
Fixes and remakes the scraper in Typescript.
Added additional dev_utils to read an
.xlsxfile of your own collection split into sheets of colors and adds the card price and the card number.What fixes?
How can this be tested?
No tests were written.
All testing can be done by
npm ciin the subdirectory to get the npm_modules.Afterwards you can run the
npm run startscript to test the web scraper.