From 84c176ac09a264f03e76d7db7b220690dbe37bd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B3=E5=85=83=E7=9A=93?= Date: Mon, 19 May 2025 22:59:55 +0800 Subject: [PATCH] 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 >_< --- README.md | 3 ++ .../checks/checkKidUnfriendlyContent.ts | 2 +- database/README.md | 16 +--------- database/kidunfriendlycontent.json | 18 ++++++++++++ pages/demo.vue | 14 --------- pages/desktop.vue | 2 +- pages/tools/checkweirdkeywords.vue | 29 +++++++++++++++++++ .../api/contentcheck/kidunfriendlycontent.ts | 17 ++++++++++- 8 files changed, 69 insertions(+), 32 deletions(-) create mode 100644 database/kidunfriendlycontent.json delete mode 100644 pages/demo.vue create mode 100644 pages/tools/checkweirdkeywords.vue diff --git a/README.md b/README.md index 4d67f34..1d55ba5 100644 --- a/README.md +++ b/README.md @@ -95,3 +95,6 @@ App Design: [PDF Document](/design.pdf) ### 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. + +## 有問題? Got questions? +Use this form: https://yhw.tw/SaBta diff --git a/components/checks/checkKidUnfriendlyContent.ts b/components/checks/checkKidUnfriendlyContent.ts index 13c2fbf..a5405fa 100644 --- a/components/checks/checkKidUnfriendlyContent.ts +++ b/components/checks/checkKidUnfriendlyContent.ts @@ -8,7 +8,7 @@ async function checkUnsafeContent(title: string) { console.log(patterns); newsAnalyzer.setSensitivePatterns(patterns); const kidfriendly = newsAnalyzer.isKidFriendly(title); - return kidfriendly; + return !kidfriendly; } catch (e) { console.log(e); } diff --git a/database/README.md b/database/README.md index 490c3fe..9f133bf 100644 --- a/database/README.md +++ b/database/README.md @@ -1,15 +1 @@ -# Database contents -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 - -``` +# 資料庫資訊 Database info diff --git a/database/kidunfriendlycontent.json b/database/kidunfriendlycontent.json new file mode 100644 index 0000000..bc954db --- /dev/null +++ b/database/kidunfriendlycontent.json @@ -0,0 +1,18 @@ +{ + "words": [ + "尺度太小", + "比基尼", + "無罩", + "脫褲", + "裸露", + "露豐", + "V辣", + "激露", + "E級曲線", + "放0肩", + "透視裝", + "性侵", + "裸照", + "性感" + ] +} diff --git a/pages/demo.vue b/pages/demo.vue deleted file mode 100644 index ca03a34..0000000 --- a/pages/demo.vue +++ /dev/null @@ -1,14 +0,0 @@ - - diff --git a/pages/desktop.vue b/pages/desktop.vue index 33c1c1f..4d4d092 100644 --- a/pages/desktop.vue +++ b/pages/desktop.vue @@ -541,7 +541,7 @@ watchEffect((cleanupFn) => {
diff --git a/pages/tools/checkweirdkeywords.vue b/pages/tools/checkweirdkeywords.vue new file mode 100644 index 0000000..3e8d4f3 --- /dev/null +++ b/pages/tools/checkweirdkeywords.vue @@ -0,0 +1,29 @@ + + diff --git a/server/api/contentcheck/kidunfriendlycontent.ts b/server/api/contentcheck/kidunfriendlycontent.ts index 58d6bad..f060425 100644 --- a/server/api/contentcheck/kidunfriendlycontent.ts +++ b/server/api/contentcheck/kidunfriendlycontent.ts @@ -1,6 +1,21 @@ import sql from "~/server/components/postgres"; export default defineEventHandler(async (event) => { return { - words: ["violence", "kill", "太小"], + words: [ + "尺度太小", + "比基尼", + "無罩", + "脫褲", + "裸露", + "露豐", + "V辣", + "激露", + "E級曲線", + "放0肩", + "透視裝", + "性侵", + "裸照", + "性感", + ], }; });