diff --git a/seeds/09_manyvids.js b/seeds/09_manyvids.js index ac7a7acb..7a4aec15 100644 --- a/seeds/09_manyvids.js +++ b/seeds/09_manyvids.js @@ -4,12 +4,13 @@ const unprint = require('unprint'); const slugify = require('../src/utils/slugify'); const limit = Number(process.env.MV_LIMIT) || 1000; +const sorting = process.env.MV_SORT || 'followers'; // followers, top, mostActive, newest, trending async function fetchCreators(page = 1, acc = []) { console.log(`Fetching creators ${acc.length}/${limit}`); // size seems to be capped at 70 - const res = await unprint.get(`https://api.manyvids.com/search/creators/list?contentPref=1,2,3&sort=top&size=50&from=${(page - 1) * 50}`); + const res = await unprint.get(`https://api.manyvids.com/search/creators/list?contentPref=1,2,3&sort=${sorting}&size=50&from=${(page - 1) * 50}`); if (res.ok && res.data?.creators) { const creators = acc.concat(res.data.creators.map((creator) => ({