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

feat(route): Add 北京邮电大学校内通知/新闻 #15156

Closed
wants to merge 16 commits into from

Conversation

YouXam
Copy link

@YouXam YouXam commented Apr 8, 2024

Involved Issue / 该 PR 相关 Issue

Add 北京邮电大学校内通知/新闻

Example for the Proposed Route(s) / 路由地址示例

/bupt/news
/bupt/news/1154

New RSS Route Checklist / 新 RSS 路由检查表

  • New Route / 新的路由
  • Anti-bot or rate limit / 反爬/频率限制
    • If yes, do your code reflect this sign? / 如果有, 是否有对应的措施?
  • Date and time / 日期和时间
    • Parsed / 可以解析
    • Correct time zone / 时区正确
  • New package added / 添加了新的包
  • Puppeteer

Note / 说明

需要有北京邮电大学校园网环境。

Need to have BUPT network environment.

import { load } from 'cheerio';
import { Context } from 'hono';
import cache from '@/utils/cache';
import got from 'got';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got is only available dev environment and is treated as deprecated by RSSHub.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got is only available dev environment and is treated as deprecated by RSSHub.

What should I use? ofetch doesn't seem to be able to get response headers, let alone handle cookies. Can I use fetch-cookies?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use ofetch in raw mode like #15140.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see tough-cookie in the dependencies, but ofetch shouldn't be able to use cookieJar directly, right? Do I have to manage cookies manually?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

pull bot added 6 commits April 8, 2024 18:13
[pull] master from diygod:master
[pull] master from diygod:master
[pull] master from diygod:master
[pull] master from diygod:master
[pull] master from diygod:master
[pull] master from diygod:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants