Giter Club home page Giter Club logo

rssworker's Introduction

RSSWorker

RSSWorker 是一个轻量级的 RSS 订阅工具,可以部署在 Cloudflare Worker 上。

支持

注:以下路由均在 [域名]/rss/ 下,如 https://example.com/rss/bilibili/user/dynamic/1

  • bilibili 动态 (/bilibili/user/dynamic/:uid)
  • bilibili 视频 (/bilibili/user/video/:uid)
  • telegram 频道 (/telegram/channel/:username)
  • weibo 用户 (/weibo/user/:uid)
  • 小红书用户 (/xiaohongshu/user/:uid)

小红书更新后不能再使用小红书号,需要使用小红书用户ID。
获取方法:
移动端:用户页面 > 右上角三个点 > 复制链接 > 获取链接中的用户ID
网页端:用户页面 > 链接中的用户ID
格式:https://www.xiaohongshu.com/user/profile/5d2aec020000000012037401

部署

Deploy to Cloudflare Workers

开发

src/lib/[网站名称]/[功能] 参照已有的 demo 添加脚本,然后在 src/route.js 中添加插件即可。

注意事项:

  1. Cloudflare Worker 有最大打包体积限制(免费用户 1 MB,付费用户 10 MB),所以插件需要尽量轻量化。如使用 fetch 进行请求、使用 Cloudflare Worker 提供的 HTMLRewriter 进行 HTML 解析等。

模板引擎使用的格式为:

let items = [
	{
		title: 'Bilibili User Dynamic',
		link: `https://space.bilibili.com/${uid}/dynamic`,
		description: 'Bilibili User Dynamic233',
		pubDate: new Date().toUTCString(),
		guid: `https://space.bilibili.com/${uid}/dynamic`,
		author: '[email protected]',
		category: 'video',
		comments: `https://space.bilibili.com/${uid}/dynamic`,
		enclosure: {
			url: 'https://www.bilibili.com/favicon.ico',
			type: 'image/x-icon',
			length: 0,
		},
		source: {
			title: 'Bilibili',
			url: 'https://www.bilibili.com',
		},
	},
];
let data = {
    title: `bilibili 动态`,
    link: `https://space.bilibili.com/${uid}/dynamic`,
    description: `${globalUsername} 的 bilibili 动态`,
    language: 'zh-cn',
    category: 'bilibili',
    items: items,
};

致谢

  • RSSHub 灵感和部分代码来源

rssworker's People

Contributors

szhu25 avatar yllhwa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

rssworker's Issues

500 - Internal Server Error

之前还是正常的,今天突然访问不了

debug message: TypeError: Cannot read properties of undefined (reading 'slice')

stack:
TypeError: Cannot read properties of undefined (reading 'slice')
at getUser (worker.js:20997:19)
at async deal4 (worker.js:21010:7)
at async worker.js:4087:62

image
image

哔哩哔哩RSS订阅异常。

Screenshot 2024-04-10 at 6 56 25 PM 订阅哔哩哔哩的时候,出现一个很奇怪的现象。同样的一个订阅源有时候打开是正常的,有时候加载出现问题,如图页面加载不出来。过段时间再打开这个订阅源,它又能够加载了。

小红书爬取的内容无法显示正文内容

如题,以作者贴出的小红书号为例。

只能抓取标题里面的文字,正文的文字需要浏览 https://www.xiaohongshu.com/explore/658ffffb0000000011030663

才能看到,也就是在link标签中。

是否有其他的办法将正文加进去?

<item>
        <title><![CDATA[大家都深爱着地球呀˵>ㅿ<˵!!~]]></title>
        <link>https:&#x2F;&#x2F;www.xiaohongshu.com&#x2F;user&#x2F;profile&#x2F;5d2aec020000000012037401&#x2F;658ffffb0000000011030663</link>
        <description><![CDATA[<img src ="http://sns-webpic-qc.xhscdn.com/202405161226/c4e6f9154001e7d6917e3900962c7a55/1040g2sg30taa7k6t3q005n9atg14mt01mhe2cm0!nc_n_nwebp_mw_1"><br>大家都深爱着地球呀˵>ㅿ<˵!!~]]></description>
        <author>雪糍</author>
    </item>

小红书订阅源没有pubDate

图1为小红书订阅源,图2为Bilibili订阅源。可以看见,小红书订阅源爬取的XML没有笔记的发布日期pubDate,这导致订阅小红书源时,没有按照顺序推送历史笔记。我不懂编程,不知道该如何添加pubDate……
小红书源:/rss/xiaohongshu/user/5efdeba4000000000101e7e6
Bilibili源(有时可能失效,疑似跟爬取频率有关):/rss/bilibili/user/dynamic/1405395281
RSS爬取的小红书XML格式
RSS爬取的B站XML格式

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.