Skip to content

Commit

Permalink
add news page
Browse files Browse the repository at this point in the history
  • Loading branch information
hello-world-1989 committed May 7, 2024
1 parent 9b4b078 commit 2d811ec
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 11 deletions.
26 changes: 24 additions & 2 deletions src/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ app.use('/tweet-page-7', async (req, res) => {

const pdfData = {
tweets,
baseUrl: 'https://end-gfw.com',
};

res.render('tweet', pdfData);
Expand Down Expand Up @@ -152,7 +151,6 @@ app.get('/tweet-page', async (req, res) => {

const pdfData = {
tweets,
baseUrl: 'https://end-gfw.com',
};

res.render('tweet', pdfData);
Expand All @@ -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(
Expand Down
10 changes: 5 additions & 5 deletions src/views/layouts/main.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
<head>
<meta charset='UTF-8' />
<meta name='viewport' content='width=device-width, initial-scale=1.0' />
<script src='https://end-gfw.com/tailwindcss.js'></script>
<script src='/tailwindcss.js'></script>
<link rel='icon' type='image/x-icon' href='images/default.png' />
<title>推墙运动 墙倒众人推 大翻墙运动 拆墙运动 大翻墙运动 无墙革命 免墙行动
普及翻墙 完全免费翻墙软件</title>
<title>大翻墙运动 信息倒灌行动 墙倒众人推 拆墙运动 大翻墙运动 无墙革命
免墙行动 普及翻墙 完全免费翻墙软件</title>
<meta charset='UTF-8' />
<meta
name='description'
content='推墙运动 墙倒众人推 大翻墙运动 拆除互联网防火墙 拆墙运动 声援乔鑫鑫 杨泽伟 编程随想 阮晓寰 '
content='大翻墙运动 信息倒灌行动 墙倒众人推 拆除互联网防火墙 拆墙运动 声援乔鑫鑫 杨泽伟 编程随想 阮晓寰 '
/>
<meta
name='keywords'
content='推墙运动 墙倒众人推 大翻墙运动 完全免费翻墙软件 梯子 机场 拆墙机场 回国机场 回国梯子 代理 Vmess Shadowsocks Trojan v2ray v2board Shadowrocket GFW 突破防火墙 VPN 防火墙 拆墙运动 拆墙 推墙 fanqiang 科学上网 自由上网 免费科学上网 免费翻墙 油管youtube 电脑、手机、iOS、安卓、windows、Mac、Linux 推特'
content='大翻墙运动 信息倒灌行动 墙倒众人推 完全免费翻墙软件 梯子 机场 拆墙机场 回国机场 回国梯子 代理 Vmess Shadowsocks Trojan v2ray v2board Shadowrocket GFW 突破防火墙 VPN 防火墙 拆墙运动 拆墙 推墙 fanqiang 科学上网 自由上网 免费科学上网 免费翻墙 油管youtube 电脑、手机、iOS、安卓、windows、Mac、Linux 推特'
/>
</head>
<body>
Expand Down
88 changes: 88 additions & 0 deletions src/views/news.handlebars
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<main class='relative'>
<div class='flex justify-center mt-4'>
<div class='text-lg font-bold'>
<h1><a href='https://end-gfw.com' target='_blank'>大翻墙运动:
https://end-gfw.com</a>,
<a href='https://twitter.com/end_gfw' target='_blank'>推特end_gfw</a>,
免墙Youtube, 免墙谷歌, 免墙维基百科</h1>
<h1>安卓手机使用NthLink, Orbot VPN, Cloudflare</h1>
<h1>苹果手机苹果电脑使用海外苹果账户下载NthLink, Orbot VPN, Cloudflare,
网站提供海外苹果账户</h1>
<h1>微软系统电脑使用VPNGate, NthLink,Cloudflare</h1>
</div>
</div>

<div class='flex justify-center mt-4'>

<div id='tweet'>
{{#each news}}
<div
class='max-w-full mx-4 mt-10 border-2 border-indigo-500 rounded-sm'
id='{{this.id}}'
>
<div class='bg-white px-4 py-5 sm:px-6'>
<div class='flex space-x-3'>
<div class='flex-shrink-0'>
<img
class='h-10 w-10 rounded-full'
src='/images/{{this.sourceId}}.jpg'
alt=''
/>
</div>
<div class='min-w-0 flex-1'>
<p class='text-xl font-bold text-gray-900'>
<a href='' class=''>{{this.name}}</a>
</p>
<p class='text-lg text-gray-500'>
<a href='#' class=''>{{this.createdDate}}发布</a>
</p>
</div>
<div class='flex flex-shrink-0 self-center'>
<div class='relative inline-block text-left'>
<div
class='absolute right-0 z-10 mt-2 w-56 origin-top-right rounded-md bg-white shadow-lg focus:outline-none'
role='menu'
aria-orientation='vertical'
aria-labelledby='menu-0-button'
tabindex='-1'
></div>
</div>
</div>
</div>
</div>
<div class='px-4 pb-5 sm:p-6 sm:pt-0'>
<h1 class='font-bold text-lg'>{{this.title}}</h1>
<br />
<p>
{{this.content}}
</p>
<br />
<p>

<div
class='group aspect-h-7 aspect-w-10 block w-full h-2/5 rounded-lg bg-gray-100 focus-within:ring-2 focus-within:ring-indigo-500 focus-within:ring-offset-2 focus-within:ring-offset-gray-100'
>
<img
src='/news-resource/{{this.detailImage}}'
alt=''
class='pointer-events-none object-cover'
width='w-full'
height='h-full'
/>
</div>
</p>
</div>

</div>
{{/each}}
</div>

</div>
<div class='flex justify-center mt-10 mb-10'>
<div class='text-lg font-bold'>
<h1>如果以上无法使用, 使用V2Ray系列或Outline, 订阅链接</h1>
<h1
>https://raw.githubusercontent.com/hello-world-1989/cn-news/main/end-gfw-together</h1>
</div>
</div>
</main>
8 changes: 4 additions & 4 deletions src/views/tweet.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<h1>安卓手机使用NthLink, Orbot VPN, Cloudflare</h1>
<h1>苹果手机苹果电脑使用海外苹果账户下载NthLink, Orbot VPN, Cloudflare,
网站提供海外苹果账户</h1>
<h1>微软系统电脑使用VPNGate</h1>
<h1>微软系统电脑使用VPNGate, NthLink, Cloudflare</h1>
</div>
</div>

Expand All @@ -17,15 +17,15 @@
<div id='tweet'>
{{#each tweets}}
<div
class='max-w-full mx-4 mt-20 border-2 border-indigo-500 rounded-sm'
class='max-w-full mx-4 mt-10 border-2 border-indigo-500 rounded-sm'
id='{{this.id}}'
>
<div class='bg-white px-4 py-5 sm:px-6'>
<div class='flex space-x-3'>
<div class='flex-shrink-0'>
<img
class='h-10 w-10 rounded-full'
src='https://end-gfw.com/images/whyyoutouzhele.jpg'
src='/images/whyyoutouzhele.jpg'
alt=''
/>
</div>
Expand Down Expand Up @@ -85,4 +85,4 @@
>https://raw.githubusercontent.com/hello-world-1989/cn-news/main/end-gfw-together</h1>
</div>
</div>
</main>
</main>

0 comments on commit 2d811ec

Please sign in to comment.