mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 15:51:01 +08:00
Remove & made the words system based on github NOT nuking this repo :)
This commit is contained in:
parent
5f3a721339
commit
e2adcf71b8
@ -1 +0,0 @@
|
|||||||
# 資料庫資訊 Database info
|
|
@ -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;
|
||||||
"裸照",
|
|
||||||
"性感",
|
|
||||||
"找妹",
|
|
||||||
"肉蹼",
|
|
||||||
"超兇北半球",
|
|
||||||
"大露",
|
|
||||||
"色誘",
|
|
||||||
"死亡",
|
|
||||||
"撩妹",
|
|
||||||
"裸上身",
|
|
||||||
],
|
|
||||||
};
|
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user