Skip to content

Conversation

@TheMrFrick
Copy link

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?

  • Scraper pointed to an older version of the website.

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.

@TheMrFrick TheMrFrick changed the title Feature/remake to ts version feat: Remake the Scraper in TS. -- Does not touch the UI. May 22, 2022
Copy link
Contributor

@Xotl Xotl left a 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_*
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
reworkedCards.json_*
reworkedCards.json_*

{
"docwriter.progress.trackFunctions": false,
"docwriter.progress.trackMethods": false
} No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
}
}

}

return result;
} No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
}
}

era: find('dl.eraCol dd').text().trim(),
cardImageUrl: getImageUrl(find('.cardimg > img')).trim(),
};
} No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
}
}

function extractCategoryFromHref(hrefString: string): string | undefined {
const match = hrefString.match(HREF_REGEXP);
return match?.groups?.category;
} No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
}
}


}
console.log('programming is running');
main(); No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
main();
main();

// console.log(cards);
console.log(`${cards.length} cards found!`)
}
testCardScraper(); No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
testCardScraper();
testCardScraper();

writeFileSync(DEFAULT_OUTPUT, JSON.stringify({...(cardListJSON as any)}));
}

main(); No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
main();
main();

}
}

main(); No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
main();
main();

}

// promptUser('test');
main(); No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
main();
main();

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.

2 participants