adding or replacing sort params for provider urls when necessary

This commit is contained in:
orangecoding
2021-11-26 21:02:09 +01:00
parent aad0884976
commit c1c4d55ede
14 changed files with 135 additions and 2 deletions

View File

@@ -4,6 +4,7 @@ const { setKnownListings, getKnownListings } = require('./services/storage/listi
const notify = require('./notification/notify');
const xray = require('./services/scraper');
const scrapingAnt = require('./services/scrapingAnt');
const urlModifier = require('./services/queryStringMutator');
class FredyRuntime {
/**
@@ -24,7 +25,8 @@ class FredyRuntime {
execute() {
return (
Promise.resolve(this._providerConfig.url)
//modify the url to make sure search order is correctly set
Promise.resolve(urlModifier(this._providerConfig.url, this._providerConfig.sortByDateParam))
//scraping the site and try finding new listings
.then(this._getListings.bind(this))
//bring them in a proper form (dictated by the provider)