From 2d811ec502785e99b22a389376173aa26fb4afbc Mon Sep 17 00:00:00 2001
From: program think backup
<103631137+hello-world-1989@users.noreply.github.com>
Date: Tue, 7 May 2024 09:17:21 +0000
Subject: [PATCH] add news page
---
src/proxy.js | 26 ++++++++-
src/views/layouts/main.handlebars | 10 ++--
src/views/news.handlebars | 88 +++++++++++++++++++++++++++++++
src/views/tweet.handlebars | 8 +--
4 files changed, 121 insertions(+), 11 deletions(-)
create mode 100644 src/views/news.handlebars
diff --git a/src/proxy.js b/src/proxy.js
index fe111c2..7f94151 100644
--- a/src/proxy.js
+++ b/src/proxy.js
@@ -110,7 +110,6 @@ app.use('/tweet-page-7', async (req, res) => {
const pdfData = {
tweets,
- baseUrl: 'https://end-gfw.com',
};
res.render('tweet', pdfData);
@@ -152,7 +151,6 @@ app.get('/tweet-page', async (req, res) => {
const pdfData = {
tweets,
- baseUrl: 'https://end-gfw.com',
};
res.render('tweet', pdfData);
@@ -161,6 +159,30 @@ app.get('/tweet-page', async (req, res) => {
}
});
+app.get('/news-page', async (req, res) => {
+ const year = req.query?.year;
+ const month = req.query?.month;
+ const day = req.query?.day;
+ const sourceId = req.query?.sourceId;
+ const newsId = req.query?.newsId;
+
+ try {
+ const response = await axios.get(
+ `https://raw.githubusercontent.com/hello-world-1989/json/main/news/${year}/${month}/${day}/${sourceId}.json`
+ );
+
+ const news = response?.data?.filter((item) => item.id == newsId);
+
+ const newsData = {
+ news: news,
+ };
+
+ res.render('news', newsData);
+ } catch (err) {
+ console.log(err);
+ }
+});
+
app.use('/github', async (req, res) => {
try {
const response = await axios.get(
diff --git a/src/views/layouts/main.handlebars b/src/views/layouts/main.handlebars
index 0512dd7..acbd204 100644
--- a/src/views/layouts/main.handlebars
+++ b/src/views/layouts/main.handlebars
@@ -2,18 +2,18 @@
-
+
- 推墙运动 墙倒众人推 大翻墙运动 拆墙运动 大翻墙运动 无墙革命 免墙行动
- 普及翻墙 完全免费翻墙软件
+ 大翻墙运动 信息倒灌行动 墙倒众人推 拆墙运动 大翻墙运动 无墙革命
+ 免墙行动 普及翻墙 完全免费翻墙软件
diff --git a/src/views/news.handlebars b/src/views/news.handlebars
new file mode 100644
index 0000000..da7ba10
--- /dev/null
+++ b/src/views/news.handlebars
@@ -0,0 +1,88 @@
+
+
+
+
+
安卓手机使用NthLink, Orbot VPN, Cloudflare
+
苹果手机苹果电脑使用海外苹果账户下载NthLink, Orbot VPN, Cloudflare,
+ 网站提供海外苹果账户
+
微软系统电脑使用VPNGate, NthLink,Cloudflare
+
+
+
+
+
+
+
+
+
+
+
如果以上无法使用, 使用V2Ray系列或Outline, 订阅链接
+ https://raw.githubusercontent.com/hello-world-1989/cn-news/main/end-gfw-together
+
+
+
\ No newline at end of file
diff --git a/src/views/tweet.handlebars b/src/views/tweet.handlebars
index 592fdae..d5f6ddf 100644
--- a/src/views/tweet.handlebars
+++ b/src/views/tweet.handlebars
@@ -8,7 +8,7 @@
安卓手机使用NthLink, Orbot VPN, Cloudflare
苹果手机苹果电脑使用海外苹果账户下载NthLink, Orbot VPN, Cloudflare,
网站提供海外苹果账户
- 微软系统电脑使用VPNGate
+ 微软系统电脑使用VPNGate, NthLink, Cloudflare
@@ -17,7 +17,7 @@