Compare commits

..

No commits in common. "cdb44655b7747e9541318ad6187856e4cfcb2e6a" and "a2fdf862dd4278d17332d30b9999fb2beed42f62" have entirely different histories.

2 changed files with 2 additions and 6 deletions

View File

@ -38,8 +38,6 @@ services:
environment:
PORT: 8081
BOT_API_URI: "http://bot-api:8080"
GELBOORU_IMAGES_PER_REQUEST: 100 # Number of images per request, maximum 100
GELBOORU_TAGS: "2girls sleeping" # Tags of the images. The images will have all of these tags
volumes:
- ./:/usr/src/app:ro

View File

@ -1,12 +1,10 @@
import { env } from "bun";
import GelbooruApiResponse from "src/types/GelbooruApiResponse";
import GelbooruServiceResponse from "src/types/GelbooruServiceResponse";
class GelbooruApiService {
async get(): Promise<GelbooruServiceResponse> {
const LIMIT = env.GELBOORU_IMAGES_PER_REQUEST || 100;
const TAGS = encodeURIComponent(env.GELBOORU_TAGS || "");
const url: string = `https://gelbooru.com/index.php?page=dapi&s=post&q=index&limit=${LIMIT}&json=1&tags=${TAGS}`;
const limit = 100;
const url: string = `https://gelbooru.com/index.php?page=dapi&s=post&q=index&limit=${limit}&json=1&tags=2girls+sleeping`
const response: GelbooruApiResponse = await fetch(url)
.then(res => {