fix: scrape strains alphabetically
ensures that we get everything
This commit is contained in:
@@ -8,14 +8,14 @@ const adapter = new FileAsync('db.json');
|
||||
const xhr = axios.create({
|
||||
headers: {
|
||||
Accept: 'application/json, text/plain, */*',
|
||||
Referer: 'https://www.leafly.com/explore',
|
||||
Referer: 'https://www.leafly.com/explore/sort-alpha',
|
||||
},
|
||||
});
|
||||
|
||||
const pSeries = tasks => tasks.reduce((c, task) => c.then(task), Promise.resolve());
|
||||
|
||||
const getPage = async num => {
|
||||
const url = `https://www.leafly.com/explore/page-${num}`;
|
||||
const url = `https://www.leafly.com/explore/page-${num}/sort-alpha`;
|
||||
const response = await xhr.get(url, {
|
||||
responseType: 'json',
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user