Remove & made the words system based on github NOT nuking this repo :)

This commit is contained in:
yuanhau 2025-06-09 14:33:20 +08:00
parent 5f3a721339
commit e2adcf71b8
3 changed files with 22 additions and 28 deletions

View file

@ -1 +0,0 @@
# 資料庫資訊 Database info

View file

@ -1,29 +1,24 @@
import sql from "~/server/components/postgres"; let cachedWords: content | null = null;
let lastFetchTime: number | null = null;
const CACHE_DURATION = 1000 * 60 * 60 * 3; // Updates every 3 hours.
interface content {
data: string[];
}
export default defineEventHandler(async (event) => { export default defineEventHandler(async (event) => {
return { const currentTime = Date.now();
words: [ if (
"尺度太小", cachedWords &&
"比基尼", lastFetchTime &&
"無罩", currentTime - lastFetchTime < CACHE_DURATION
"脫褲", ) {
"裸露", return cachedWords;
"露豐", }
"V辣", const fetchWordsFromGitHub = await fetch(
"激露", "https://raw.githubusercontent.com/hpware/news-analyze/refs/heads/master/words.json",
"E級曲線", );
"放0肩", cachedWords = await fetchWordsFromGitHub.json();
"透視裝", lastFetchTime = currentTime;
"性侵", return cachedWords;
"裸照",
"性感",
"找妹",
"肉蹼",
"超兇北半球",
"大露",
"色誘",
"死亡",
"撩妹",
"裸上身",
],
};
}); });