mwpenny / kijiji-scraper

A lightweight node.js module for retrieving and scraping ads from Kijiji

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create helper types for enums, and expose expected response attributes

mwpenny opened this issue · comments

Better attribute handling would make this library easier to use and avoid the need to guess/experiment as much when using it. Additionally, the meaning of some attribute values is not obvious (see #65).

This issue tracks two related enhancements:

  1. Some ad attributes are enums. Currently, kijiji-scraper exposes the internal value. Create helper types (similar to those that exist for location and category IDs) for exposing all possible enums, their entries, and the corresponding internal values.
  2. The possible attributes an ad can have depend on its category. Provide a way to determine all possible attributes that may be returned when scraping/searching (ideally at compile time via TypeScript, with a run-time API for JavaScript users).