mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-24 00:01:03 +08:00
feat: restructure README, remove Google and Yahoo components, and implement hot news display
This commit is contained in:
parent
8198010268
commit
a5af4c04f7
16
README.md
16
README.md
@ -1,7 +1,20 @@
|
|||||||
# 新聞解析 / News Analyze
|
# 新聞解析 / News Analyze
|
||||||
|
|
||||||
## Stack:
|
## Why?
|
||||||
|
我們使用這個新聞來舉例:
|
||||||
|
```
|
||||||
|
朱立倫批政府像希特勒德國在台協會:不應為政治扭曲歷史| 政治 - 中央社 CNA
|
||||||
|
5/7/2025, 11:17:00 PM
|
||||||
|
類似新聞:
|
||||||
|
- 朱立倫批政府像希特勒德國在台協會:不應為政治扭曲歷史| 政治 - 中央社 CNA
|
||||||
|
- 快訊/硬起來!朱立倫回擊德國在台協會:外國政府不該干預各國內政 - 富房網
|
||||||
|
- 綠委憂希特勒說釀災 外交部:全力向駐台館處說明 - 經濟日報
|
||||||
|
- 「朱立倫道歉」!亂比喻遭德國、以色列譴責 民進黨:賠上台灣國際名譽 - 奇摩新聞
|
||||||
|
- 洪聖斐觀點》獨裁餘毒罵人「法西斯」 朱立倫東施效顰共產黨| 政治 - Newtalk新聞
|
||||||
|
```
|
||||||
|
你會看到許多觀點,但不知道這些新聞為什麼會寫比較偏見的文章。
|
||||||
|
|
||||||
|
## Stack:
|
||||||
- Postgres
|
- Postgres
|
||||||
- Passport.js
|
- Passport.js
|
||||||
- Tailwind
|
- Tailwind
|
||||||
@ -12,3 +25,4 @@
|
|||||||
- Minio S3
|
- Minio S3
|
||||||
- Nuxt i18N
|
- Nuxt i18N
|
||||||
- BunJS
|
- BunJS
|
||||||
|
- Groq
|
@ -4,6 +4,7 @@ export default defineNuxtConfig({
|
|||||||
routeRules: {
|
routeRules: {
|
||||||
"/": { redirect: "/home" },
|
"/": { redirect: "/home" },
|
||||||
"/zh_tw": { redirect: "/zh_tw/home" },
|
"/zh_tw": { redirect: "/zh_tw/home" },
|
||||||
|
//"/api/rss/**": { swr: 3600 },
|
||||||
},
|
},
|
||||||
css: ["~/styles/main.css"],
|
css: ["~/styles/main.css"],
|
||||||
modules: [
|
modules: [
|
||||||
|
39
pages/app/hot/index.vue
Normal file
39
pages/app/hot/index.vue
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
<script lang="ts" setup>
|
||||||
|
const ffeed = ref();
|
||||||
|
const ass = ['健康2.0', '中天', 'TVBS', '香港01', "ETtoday"];
|
||||||
|
|
||||||
|
try {
|
||||||
|
const { data } = await useFetch('/api/rss/google')
|
||||||
|
ffeed.value = data.value
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error:', error)
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div v-for="item in ffeed" class="justify-center align-center text-center p-4 border border-white rounded-lg m-4">
|
||||||
|
{{ item }}
|
||||||
|
<span class="text-xl text-bold text-gray-100">{{ item.title }}
|
||||||
|
<span v-if="ass.some((app) =>
|
||||||
|
item.title.includes(app)
|
||||||
|
)"
|
||||||
|
class="text-red-500 text-sm">
|
||||||
|
- 疑似來自有中資背景公司
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
<h4 class="text-gray-500 text-sm">{{ new Date(item.date).toLocaleString() }}</h4>
|
||||||
|
類似新聞:
|
||||||
|
<div v-for="itit in item.content">
|
||||||
|
<ul v-for="ititit in itit">
|
||||||
|
<li v-if="ititit.content?.[0].content[0] !== item.title">
|
||||||
|
- <a :href="ititit.content?.[0].attributes?.href">{{ ititit.content?.[0].content[0] }}</a> - <a :href="'/find/newsOrg?name=' + ititit.content?.[2].content[0]">{{ ititit.content?.[2].content[0] }}</a>
|
||||||
|
<span v-if="ass.some((app) => ititit.content?.[2].content[0].includes(app))"
|
||||||
|
class="text-red-500 text-sm">
|
||||||
|
- 疑似來自有中資背景公司
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
@ -1,36 +0,0 @@
|
|||||||
<script lang="ts" setup>
|
|
||||||
const ffeed = ref();
|
|
||||||
|
|
||||||
try {
|
|
||||||
const { data } = await useFetch('/api/rss/google')
|
|
||||||
ffeed.value = data.value
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error:', error)
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<hr/>
|
|
||||||
<div v-for="item in ffeed">
|
|
||||||
<span>{{ item.title }}
|
|
||||||
<span v-if="item.title.includes('.cn') || item.title.includes('健康2.0') ||
|
|
||||||
item.title.includes('中天') || item.title.includes('TVBS') ||
|
|
||||||
item.title.includes('香港01')"
|
|
||||||
class="text-red-500 text-sm">
|
|
||||||
- 疑似來自有中資背景公司
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
<h4>{{ item.date }}</h4>
|
|
||||||
類似新聞:
|
|
||||||
<div v-for="itit in item.content">
|
|
||||||
{{ itit }}
|
|
||||||
<ul v-for="ititit in itit">
|
|
||||||
<li>
|
|
||||||
- {{ ititit.content?.[0].content[0] }} - {{ ititit.content?.[2].content[0] }}
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<hr/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
@ -1,3 +0,0 @@
|
|||||||
<template>
|
|
||||||
https://tw.news.yahoo.com/rss/
|
|
||||||
</template>
|
|
5
server/routes/find/newsOrg.ts
Normal file
5
server/routes/find/newsOrg.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
const query = getQuery(event)
|
||||||
|
const name = query.name
|
||||||
|
return name;
|
||||||
|
})
|
Loading…
x
Reference in New Issue
Block a user