1
0

Add .file class + Generator user agent

This commit is contained in:
venashial
2022-07-02 22:14:20 -07:00
parent 64ed5fca3b
commit f62723c274
19 changed files with 198 additions and 106 deletions

View File

@@ -1,8 +1,8 @@
import { fetch } from 'undici'
import { fetch } from '../fetch.js'
import { promises as fs } from 'fs'
import cliProgress from 'cli-progress'
export async function landingPage(API_URL) {
export async function landingPage() {
const progressBar = new cliProgress.SingleBar({
format: 'Generating landing page | {bar} | {percentage}% || {value}/{total} mods',
barCompleteChar: '\u2588',
@@ -12,9 +12,7 @@ export async function landingPage(API_URL) {
progressBar.start(100, 0)
// Fetch top 100 mods
const response = await (
await fetch(API_URL + 'search?limit=100&facets=[["project_type:mod"]]')
).json()
const response = await (await fetch('search?limit=100&facets=[["project_type:mod"]]')).json()
// Simplified array with the format: ['id', 'slug', 'icon_extension']
const compressed = response.hits