Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

只抓取公众号当天的头条文章(封面文章) #174

Open
gongyan200 opened this issue Jun 17, 2024 · 2 comments
Open

只抓取公众号当天的头条文章(封面文章) #174

gongyan200 opened this issue Jun 17, 2024 · 2 comments

Comments

@gongyan200
Copy link

增加HEADLINES_ONLY环境变量,仅抓取头条文章

/apps/server/src/trpc/trpc.service.ts文件167行位置处增加以下代码
if process.env.HEADLINE_ONLY == true
articles = articles.slice(-1);

这段代码的前提假设是:头条文章比普通文章发布时间更早,按顺序抓取到的最后一篇文章即为头条文章。

不知道我的这个理解对不对,如果可以的话,辛苦添加一下这个功能 ❤️

@gongyan200
Copy link
Author

另一个取巧的方式
修改 /apps/server/src/feeds/feeds.controller.ts 第49行
@query('limit', new DefaultValuePipe(10), ParseIntPipe) limit: number = 10,
将10改为1,每次刷新只抓取rss里最新的文章,也即头条文章

@le0zh0u
Copy link

le0zh0u commented Jun 27, 2024

为啥只需要头条文章。。上面的两个方法感觉会导致文章丢失,比如连续发了两次,只能获取到最新的一篇文章

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants