Releases: mwpenny/kijiji-scraper
Version 6.1.0 (result count enhancements)
This release slightly changes how the minResults
and maxResults
search options work in order to support
- Searching with no limit, and
- Searching using only
maxResults
To support these two use cases, the following changes were made:
- A negative value for
minResults
will mean "no limit" (return all results), and minResults
will take on the value ofmaxResults
if:minResults === undefined
andmaxResults > 0
, orminResults
is negative (prevents over-fetching now that no limit searching is supported)
Otherwise, the current behavior is unchanged. If minResults
is unspecified then its default will still be 20
(as long as maxResults
is not positive), and if minResults
is non-negative then no meddling will occur.
Version 6.0.0 (mobile API support)
-
Kijiji mobile API will be used by default
- You can use the old method if you want by using the new Scraper Options type.
Ad.Get()
takes it as an argument andsearch()
accepts thescraperType
property in the existingoptions
argument. Note that some search parameters are affected by this change (e.g.,params.keywords
->params.q
). scrapeResultDetails
is no longer necessary when using the API and will only have an effect if using the HTML scraper
- You can use the old method if you want by using the new Scraper Options type.
-
Added configurable rate limiting when performing a search (to avoid being blocked)
pageDelayMs
can be used to add a delay between each page of results- When
scrapeResultDetails
is set totrue
,resultDetailsDelayMs
can be used to add a delay in between each request for details (note that this forces the requests to be executed serially rather than in parallel like they were up until now - a value of0
is the same as the old behavior)
-
The module will detect if you get blocked and throw an error letting you know. It should be more difficult to get into this situation now, but is good to have anyway. More investigation is needed to determine the exact triggers for a block - Kijiji seems to be tweaking it.
Version 5.1.1 (TypeScript refactor)
The module has been converted to TypeScript and unit tests have been added. Internally, this means that it is easier and quicker to make future changes with confidence. Externally, it means that other TypeScript projects will be able to use kijiji-scraper with type checking. The new type definitions are also fully commented with TSDoc comments to serve as easily accessible documentation regardless of whether or not you are using TypeScript.
Version 4.0.0
This release is a major refactor. Several ES6 features are now used internally, and there are a few externally-facing features as well.
- Scraping and string conversion is now done through the new
Ad
class- The same
Ad
object is used for both search results and single ads
- The same
- Search result paging has been implemented and the maximum/minimum number of results to fetch/return can now be specified when searching
- Two objects,
locations
andcategories
, have been defined to make usinglocationId
andcategoryId
easier. They contain all possible locations and categories that Kijiji accepts, are nested in the same way as on the Kijiji website, and can be used in place of integers forlocationId
andcategoryId
. - Full promise support (callbacks are still supported as optional final parameters)
Version 2.0.1
- Support new Kijiji UI
- Retrieve entire image gallery for ad (thanks to @MrDOS)
Version 1.2.0
- Use newer version of dependencies
- Version bump to be consistent with kijiji-fb-bot
Initial release
- Retrieve single ads as JSON objects given their URL
- Retrieve the 20 latest ads matching given search criteria