Releases: dilaouid/FandomScraper
1.0.3 - Improved Query Methods and Deprecation
This release brings significant improvements to the query methods, as well as the deprecation of the old methods. Let's explore the details of the changes:
Improved Query Methods
In this release, I have introduced new chaining query methods that provide enhanced flexibility and control when retrieving character data from the wiki. Additionally, I have added a new method called attr() that allows you to specify the properties you want to include in the query result.
Get all characters of the current wiki
const allCharacters = await scraper.findAll({ base64: false, withId: true, recursive: true })
.limit(100)
.offset(5)
.attr('age kanji status episode images')
.ignore(['muroi'])
.exec();The findAll() method now allows you to retrieve all characters from the wiki based on the specified options. You can set options such as base64, withId, and recursive to customize the query. Additionally, you can use the new attr() method to specify which properties to include in the query result. This gives you more control over the data you receive.
Get a character by name
const character = await scraper.findByName('toshio ozaki', { base64: false, withId: true })
.attr('age kanji status episode images')
.exec();The findByName() method enables you to retrieve a specific character by their name. You can provide options such as base64 and withId to customize the query. Similar to the findAll() method, you can now use the attr() method to select the properties you want to include in the result.
Get a character by ID
const characterById = await scraper.findById(24013, { base64: false, withId: true })
.attr('name kanji age affiliations')
.exec();The findById() method allows you to retrieve a character by their ID. Similar to the other methods, you can specify options such as base64 and withId. Additionally, the new attr() method allows you to choose the properties you want to include in the result.
Deprecation of Old Methods
With this release, I have deprecated the getAll(), getByName(), and getById() methods. While these methods are still available, I strongly recommend migrating to the new chaining query methods for a more powerful and customizable querying experience.
To take advantage of the improved query methods and the new attr() method, please update your code accordingly.
If you encounter any issues or have any questions, please don't hesitate to reach me through DM or the Issues. I am here to assist you with pleasure ! ;-D
Happy scraping pal' !