Made some tools for basic users & also may or may not added a bunch of

nono keywords into the kidunfriendlycontent.json file. Oh, and most of
it is sourced from you guessed it LINE Today & Taiwan's garbage news
corps >_<
This commit is contained in:
吳元皓 2025-05-19 22:59:55 +08:00
parent 4080eeaa3e
commit 84c176ac09
8 changed files with 69 additions and 32 deletions

View File

@ -95,3 +95,6 @@ App Design: [PDF Document](/design.pdf)
### For scaping ### For scaping
First, Run `ps1 clone-env.ps1` or `bash clone-env.sh` to clone the `.env` file to the `scraping` folder, then cd into the `scraping` folder. Run `python main.py` to start scraping in Google News. First, Run `ps1 clone-env.ps1` or `bash clone-env.sh` to clone the `.env` file to the `scraping` folder, then cd into the `scraping` folder. Run `python main.py` to start scraping in Google News.
## 有問題? Got questions?
Use this form: https://yhw.tw/SaBta

View File

@ -8,7 +8,7 @@ async function checkUnsafeContent(title: string) {
console.log(patterns); console.log(patterns);
newsAnalyzer.setSensitivePatterns(patterns); newsAnalyzer.setSensitivePatterns(patterns);
const kidfriendly = newsAnalyzer.isKidFriendly(title); const kidfriendly = newsAnalyzer.isKidFriendly(title);
return kidfriendly; return !kidfriendly;
} catch (e) { } catch (e) {
console.log(e); console.log(e);
} }

View File

@ -1,15 +1 @@
# Database contents # 資料庫資訊 Database info
This is where I put the database schemas, that contains everything (the user account & password info is NOT avaiable in the backup.)
## How to import
Import the schema:
```bash
psql -d database -f database_dump.sql
```
## How to create a database_dump
Type or copy This
```bash
pg_dump -U your_username -d your_database --schema-only > schema.sql
```

View File

@ -0,0 +1,18 @@
{
"words": [
"尺度太小",
"比基尼",
"無罩",
"脫褲",
"裸露",
"露豐",
"V辣",
"激露",
"E級曲線",
"放0肩",
"透視裝",
"性侵",
"裸照",
"性感"
]
}

View File

@ -1,14 +0,0 @@
<script setup lang="ts">
import CheckKidUnfriendlyContent from "~/components/checks/checkKidUnfriendlyContent";
const title = ref("");
const system = ref(false);
const checkTitle = () => {
if (!title.value) return;
system.value = CheckKidUnfriendlyContent(title.value);
};
</script>
<template>
<input type="text" v-model="title" />
<button @click="checkTitle"></button>
<div>{{ system }}</div>
</template>

View File

@ -541,7 +541,7 @@ watchEffect((cleanupFn) => {
</Transition> </Transition>
<!--Main desktop contents--> <!--Main desktop contents-->
<div <div
class="flex flex-col justify-center align-center text-center absolute w-full h-screen inset-x-0 inset-y-0" class="flex flex-col justify-center align-center text-center absolute w-full h-screen inset-x-0 inset-y-0 z-[-10]"
id="desktop" id="desktop"
></div> ></div>
<Transition> <Transition>

View File

@ -0,0 +1,29 @@
<script setup lang="ts">
import CheckKidUnfriendlyContent from "~/components/checks/checkKidUnfriendlyContent";
const title = ref("");
const system = ref(false);
const checkTitle = async () => {
if (!title.value) return;
system.value = await CheckKidUnfriendlyContent(title.value);
};
</script>
<template>
<div
class="flex flex-col absolute h-screen w-full inset-0 justify-center align-center text-center"
>
<h1 class="text-4xl m-2">這個文章是不是使用偏色情的標體</h1>
<div class="flex flex-row justify-center align-center gap-2">
<input
type="text"
v-model="title"
class="text-black rounded-xl p-2 w-[300px]"
/>
<button @click="checkTitle" class="rounded-xl bg-sky-600 p-2">
Find
</button>
</div>
<span v-if="system" class="text-red-400 text-8xl m-8"></span>
<span v-else class="text-white">不是</span>
</div>
<div class="h-screen"></div>
</template>

View File

@ -1,6 +1,21 @@
import sql from "~/server/components/postgres"; import sql from "~/server/components/postgres";
export default defineEventHandler(async (event) => { export default defineEventHandler(async (event) => {
return { return {
words: ["violence", "kill", "太小"], words: [
"尺度太小",
"比基尼",
"無罩",
"脫褲",
"裸露",
"露豐",
"V辣",
"激露",
"E級曲線",
"放0肩",
"透視裝",
"性侵",
"裸照",
"性感",
],
}; };
}); });