Markkop / corvo-astral

A Discord Bot that serves as an Wakfu helper
https://github.com/Markkop/corvo-astral
28 stars 4 forks source link

scrap equipment drop information #21

Closed Markkop closed 4 years ago

Markkop commented 4 years ago

Would be nice to able to retrieve the drop information for a given equipment. The ideal would be to allow reactions to equipment retrieved by .equip command that would scrap that given equipment page and inserting its drop information to the message embed, similar do .alma command. Since we don't have the direct link to the equipment, we can use puppeteer to search the equipment name in Google, access its first result and scrap the data. Since we would be adding emoji reaction to get more information, we could refactor the equipment recipe information to also be shown only when reacting

Markkop commented 4 years ago

Scrapping the equipment by it's name sometimes would not work because not every equipment for each rarity is indexed on Google, so it's not reliable. Instead, we're now saving its ID in the description and using it to scrap the drop data directly from its page. We also have to infer the equipment URL because it's different for each language. The Google strategy might work for some kind of .drop command with some limitations.