-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat: Remake the Scraper in TS. -- Does not touch the UI. #89
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
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
*.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 | ||
} |
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; | ||
} |
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(), | ||
}; | ||
} |
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; | ||
} |
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(); |
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(); |
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(); |
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(); |
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(); |
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
.xlsx
file 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 ci
in the subdirectory to get the npm_modules.Afterwards you can run the
npm run start
script to test the web scraper.