Moved to subfolder "query"
parent
63aa32851b
commit
8cb92ebd3c
|
@ -1,20 +1,20 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
// Modules from file
|
// Modules from file
|
||||||
import { fetchGETResponse } from "./network-helper.js";
|
import { fetchGETResponse } from "../network-helper.js";
|
||||||
import LatestSearchQuery from "./classes/latest-search-query.js";
|
import LatestSearchQuery from "../classes/query/latest-search-query.js";
|
||||||
import { urls as f95url } from "./constants/url.js";
|
import { urls as f95url } from "../constants/url.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the URLs of the latest updated games that match the passed parameters.
|
* Gets the URLs of the latest handiworks that match the passed parameters.
|
||||||
* You *must* be logged.
|
* You *must* be logged.
|
||||||
* @param {LatestSearchQuery} query
|
* @param {LatestSearchQuery} query
|
||||||
* Query used for the search
|
* Query used for the search
|
||||||
* @param {Number} limit
|
* @param {Number} limit
|
||||||
* Maximum number of items to get. Default: 30
|
* Maximum number of items to get. Default: 30
|
||||||
* @returns {Promise<String[]>} URLs of the fetched games
|
* @returns {Promise<String[]>} URLs of the handiworks
|
||||||
*/
|
*/
|
||||||
export async function fetchLatest(query: LatestSearchQuery, limit = 30): Promise<string[]> {
|
export default async function fetchLatestHandiworkURLs(query: LatestSearchQuery, limit = 30): Promise<string[]> {
|
||||||
// Local variables
|
// Local variables
|
||||||
const threadURL = new URL("threads/", f95url.F95_BASE_URL).href;
|
const threadURL = new URL("threads/", f95url.F95_BASE_URL).href;
|
||||||
const resultURLs = [];
|
const resultURLs = [];
|
|
@ -7,10 +7,10 @@ import { readFileSync, writeFileSync, existsSync } from "fs";
|
||||||
import cheerio from "cheerio";
|
import cheerio from "cheerio";
|
||||||
|
|
||||||
// Modules from file
|
// Modules from file
|
||||||
import shared, { TPrefixDict } from "./shared.js";
|
import shared, { TPrefixDict } from "../shared.js";
|
||||||
import { urls as f95url } from "./constants/url.js";
|
import { urls as f95url } from "../constants/url.js";
|
||||||
import { selectors as f95selector} from "./constants/css-selector.js";
|
import { selectors as f95selector} from "../constants/css-selector.js";
|
||||||
import { fetchHTML } from "./network-helper.js";
|
import { fetchHTML } from "../network-helper.js";
|
||||||
|
|
||||||
//#region Interface definitions
|
//#region Interface definitions
|
||||||
/**
|
/**
|
||||||
|
@ -46,7 +46,7 @@ interface ILatestResource {
|
||||||
* Gets the basic data used for game data processing
|
* Gets the basic data used for game data processing
|
||||||
* (such as graphics engines and progress statuses)
|
* (such as graphics engines and progress statuses)
|
||||||
*/
|
*/
|
||||||
export async function fetchPlatformData(): Promise<void> {
|
export default async function fetchPlatformData(): Promise<void> {
|
||||||
// Check if the data are cached
|
// Check if the data are cached
|
||||||
if (!readCache(shared.cachePath)) {
|
if (!readCache(shared.cachePath)) {
|
||||||
// Load the HTML
|
// Load the HTML
|
Loading…
Reference in New Issue