rsshub 1.0.0-master.ff3a9ce → 1.0.0-master.ff3ea5a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/config.ts +38 -0
- package/lib/errors/index.tsx +3 -2
- package/lib/middleware/debug.ts +6 -4
- package/lib/middleware/header.ts +4 -2
- package/lib/registry.test.ts +24 -1
- package/lib/registry.ts +40 -11
- package/lib/router.js +1 -1
- package/lib/routes/121/namespace.ts +9 -0
- package/lib/routes/121/templates/description.art +17 -0
- package/lib/routes/121/weather-live.ts +104 -0
- package/lib/routes/141jav/index.ts +3 -0
- package/lib/routes/141ppv/index.ts +3 -0
- package/lib/routes/163/news/rank.ts +1 -1
- package/lib/routes/18comic/album.ts +59 -64
- package/lib/routes/18comic/index.ts +1 -0
- package/lib/routes/18comic/search.ts +53 -4
- package/lib/routes/18comic/utils.ts +70 -1
- package/lib/routes/2048/index.ts +1 -0
- package/lib/routes/30secondsofcode/utils.ts +0 -1
- package/lib/routes/6park/index.ts +1 -1
- package/lib/routes/7mmtv/index.ts +1 -0
- package/lib/routes/91porn/index.ts +1 -0
- package/lib/routes/95mm/tab.ts +1 -0
- package/lib/routes/agefans/detail.ts +1 -1
- package/lib/routes/aliyun/database-month.ts +1 -1
- package/lib/routes/anthropic/research.ts +112 -0
- package/lib/routes/apnews/topics.ts +2 -1
- package/lib/routes/apnews/utils.ts +1 -1
- package/lib/routes/apple/design.ts +54 -0
- package/lib/routes/apple/namespace.ts +1 -1
- package/lib/routes/aqara/post.ts +1 -1
- package/lib/routes/augmentcode/blog.ts +161 -0
- package/lib/routes/augmentcode/namespace.ts +9 -0
- package/lib/routes/augmentcode/templates/description.art +17 -0
- package/lib/routes/azul/namespace.ts +9 -0
- package/lib/routes/azul/packages.ts +105 -0
- package/lib/routes/banshujiang/index.ts +763 -0
- package/lib/routes/banshujiang/namespace.ts +9 -0
- package/lib/routes/banshujiang/templates/description.art +17 -0
- package/lib/routes/bfl/announcements.ts +1 -1
- package/lib/routes/bilibili/cache.ts +78 -0
- package/lib/routes/bilibili/danmaku.ts +1 -1
- package/lib/routes/bilibili/dynamic.ts +8 -2
- package/lib/routes/bilibili/video.ts +31 -73
- package/lib/routes/biquge/index.ts +1 -1
- package/lib/routes/bsky/keyword.ts +15 -10
- package/lib/routes/capitalmind/insights.ts +40 -0
- package/lib/routes/capitalmind/namespace.ts +8 -0
- package/lib/routes/capitalmind/podcasts.ts +41 -0
- package/lib/routes/capitalmind/utils.ts +122 -0
- package/lib/routes/cartoonmad/comic.ts +1 -1
- package/lib/routes/chikubi/index.ts +1 -0
- package/lib/routes/chikubi/tag.ts +1 -0
- package/lib/routes/chocolatey/namespace.ts +9 -0
- package/lib/routes/chocolatey/packages.ts +122 -0
- package/lib/routes/cmde/index.ts +1 -1
- package/lib/routes/cockroachlabs/blog.ts +113 -0
- package/lib/routes/cockroachlabs/namespace.ts +7 -0
- package/lib/routes/cool18/index.ts +4 -1
- package/lib/routes/coomer/index.ts +12 -6
- package/lib/routes/coomer/namespace.ts +1 -1
- package/lib/routes/copymanga/comic.ts +7 -9
- package/lib/routes/css-tricks/articles.ts +48 -0
- package/lib/routes/css-tricks/collections.ts +62 -0
- package/lib/routes/css-tricks/namespace.ts +8 -0
- package/lib/routes/css-tricks/popular.ts +39 -0
- package/lib/routes/css-tricks/utils.ts +103 -0
- package/lib/routes/cursor/changelog.ts +26 -17
- package/lib/routes/cursor/namespace.ts +1 -1
- package/lib/routes/cw/utils.ts +6 -13
- package/lib/routes/dealstreetasia/home.ts +1 -1
- package/lib/routes/dedao/index.ts +3 -3
- package/lib/routes/deepl/blog.ts +422 -0
- package/lib/routes/deepl/namespace.ts +9 -0
- package/lib/routes/deepl/templates/description.art +21 -0
- package/lib/routes/deeplearning/the-batch.ts +1 -1
- package/lib/routes/dev.to/guides.ts +100 -0
- package/lib/routes/dev.to/namespace.ts +8 -0
- package/lib/routes/dev.to/top.ts +105 -0
- package/lib/routes/dgut/jwb.ts +73 -0
- package/lib/routes/dgut/namespace.ts +9 -0
- package/lib/routes/digitalpolicyalert/activity-tracker.ts +135 -0
- package/lib/routes/digitalpolicyalert/namespace.ts +9 -0
- package/lib/routes/dnaindia/common.ts +26 -8
- package/lib/routes/douban/other/list.ts +3 -3
- package/lib/routes/e-hentai/index.ts +4 -1
- package/lib/routes/ehentai/tag.ts +1 -0
- package/lib/routes/englishhome/index.ts +55 -0
- package/lib/routes/englishhome/namespace.ts +6 -0
- package/lib/routes/epicgames/index.ts +2 -2
- package/lib/routes/espn/news.ts +1 -1
- package/lib/routes/expats/czech-news.ts +272 -0
- package/lib/routes/expats/namespace.ts +9 -0
- package/lib/routes/fanbox/index.ts +1 -0
- package/lib/routes/fanbox/utils.ts +1 -1
- package/lib/routes/fansly/tag.ts +1 -0
- package/lib/routes/fantia/search.ts +1 -1
- package/lib/routes/fantube/creator.ts +69 -0
- package/lib/routes/fantube/namespace.ts +7 -0
- package/lib/routes/fantube/templates/post.art +17 -0
- package/lib/routes/fantube/types.ts +100 -0
- package/lib/routes/fantube/utils.ts +268 -0
- package/lib/routes/follow/profile.ts +1 -1
- package/lib/routes/followin/news.ts +1 -1
- package/lib/routes/foresightnews/util.ts +1 -1
- package/lib/routes/freexcomic/book.ts +4 -1
- package/lib/routes/gamer/hot.ts +5 -5
- package/lib/routes/gaoyu/blog.ts +145 -0
- package/lib/routes/gaoyu/namespace.ts +9 -0
- package/lib/routes/gaoyu/templates/description.art +7 -0
- package/lib/routes/geocaching/blogs.ts +2 -2
- package/lib/routes/github/namespace.ts +1 -1
- package/lib/routes/github/private-feed.ts +229 -0
- package/lib/routes/github/star.ts +1 -1
- package/lib/routes/google/extension.ts +9 -10
- package/lib/routes/gov/beijing/bphc/index.ts +1 -1
- package/lib/routes/gov/ccdi/index.ts +1 -1
- package/lib/routes/gov/chongqing/sydwgkzp.ts +22 -6
- package/lib/routes/gov/customs/list.ts +1 -1
- package/lib/routes/gov/general/general.ts +1 -1
- package/lib/routes/gov/hangzhou/zwfw.ts +1 -1
- package/lib/routes/gov/pbc/goutongjiaoliu.ts +1 -1
- package/lib/routes/gov/shenzhen/szlh/index.ts +77 -0
- package/lib/routes/gov/shenzhen/szlh/namespace.ts +8 -0
- package/lib/routes/grist/utils.ts +5 -4
- package/lib/routes/hanime1/search.ts +4 -2
- package/lib/routes/hellogithub/report.ts +1 -1
- package/lib/routes/hit/hitgs.ts +240 -54
- package/lib/routes/hit/templates/description.art +7 -0
- package/lib/routes/hlju/namespace.ts +8 -0
- package/lib/routes/hlju/news.ts +141 -0
- package/lib/routes/hostmonit/cloudflareyes.ts +1 -1
- package/lib/routes/hotukdeals/index.ts +1 -1
- package/lib/routes/hyperdash/namespace.ts +7 -0
- package/lib/routes/hyperdash/templates/description.art +34 -0
- package/lib/routes/hyperdash/top-traders.ts +84 -0
- package/lib/routes/hyperdash/utils.ts +49 -0
- package/lib/routes/hypergryph/arknights/announce.ts +1 -1
- package/lib/routes/ielts/index.ts +1 -1
- package/lib/routes/infoq/topic.ts +16 -13
- package/lib/routes/instagram/web-api/index.ts +17 -13
- package/lib/routes/instagram/web-api/utils.ts +46 -63
- package/lib/routes/jamesclear/book-summaries.ts +40 -0
- package/lib/routes/jamesclear/great-speeches.ts +40 -0
- package/lib/routes/jamesclear/namespace.ts +8 -0
- package/lib/routes/jamesclear/quotes.ts +40 -0
- package/lib/routes/jamesclear/three-two-one.ts +41 -0
- package/lib/routes/jamesclear/utils.ts +22 -0
- package/lib/routes/japanpost/utils.ts +2 -2
- package/lib/routes/javbus/index.ts +3 -0
- package/lib/routes/javdb/tags.ts +1 -0
- package/lib/routes/javlibrary/star.ts +1 -0
- package/lib/routes/javtiful/actress.ts +3 -0
- package/lib/routes/javtiful/channel.ts +3 -0
- package/lib/routes/javtrailers/casts.ts +3 -0
- package/lib/routes/jetbrains/comments.ts +99 -0
- package/lib/routes/jetbrains/namespace.ts +8 -0
- package/lib/routes/jimmyspa/books.ts +1 -1
- package/lib/routes/jimmyspa/news.ts +1 -1
- package/lib/routes/jpxgmn/tab.ts +3 -0
- package/lib/routes/kakuyomu/works.ts +3 -0
- package/lib/routes/kaopu/news.ts +1 -1
- package/lib/routes/kemono/const.ts +1 -1
- package/lib/routes/kemono/index.ts +12 -11
- package/lib/routes/kemono/namespace.ts +1 -1
- package/lib/routes/kiro/blog.ts +131 -0
- package/lib/routes/kiro/changelog.ts +128 -0
- package/lib/routes/kiro/namespace.ts +9 -0
- package/lib/routes/konachan/post.ts +3 -0
- package/lib/routes/kovidgoyal/kitty/changelog.ts +83 -0
- package/lib/routes/kovidgoyal/namespace.ts +7 -0
- package/lib/routes/kunchengblog/essay.ts +1 -1
- package/lib/routes/landiannews/category.ts +1 -1
- package/lib/routes/landiannews/index.ts +1 -1
- package/lib/routes/landiannews/tag.ts +1 -1
- package/lib/routes/line/utils.ts +1 -1
- package/lib/routes/lineageos/changes.ts +79 -0
- package/lib/routes/lineageos/namespace.ts +9 -0
- package/lib/routes/linkedin/cn/renderer.ts +1 -1
- package/lib/routes/liquipedia/cs-matches.ts +42 -14
- package/lib/routes/literotica/new.ts +1 -0
- package/lib/routes/lofter/tag.ts +27 -3
- package/lib/routes/makerworld/contest.ts +51 -0
- package/lib/routes/makerworld/namespace.ts +7 -0
- package/lib/routes/makerworld/trending.ts +45 -0
- package/lib/routes/makerworld/user-upload.ts +54 -0
- package/lib/routes/makerworld/utils.ts +18 -0
- package/lib/routes/manhuagui/comic.ts +1 -1
- package/lib/routes/manus/blog.ts +77 -0
- package/lib/routes/manus/namespace.ts +7 -0
- package/lib/routes/mastodon/tag.ts +48 -0
- package/lib/routes/mathpix/blog.ts +155 -0
- package/lib/routes/mathpix/namespace.ts +9 -0
- package/lib/routes/mathpix/templates/description.art +21 -0
- package/lib/routes/mckinsey/cn/category-map.ts +9 -15
- package/lib/routes/mckinsey/cn/index.ts +77 -40
- package/lib/routes/melonbooks/search.ts +1 -0
- package/lib/routes/metacritic/index.ts +2 -2
- package/lib/routes/meteoblue/namespace.ts +8 -0
- package/lib/routes/meteoblue/weathernews.ts +75 -0
- package/lib/routes/meteor/index.ts +1 -1
- package/lib/routes/microsoft/addon.ts +7 -9
- package/lib/routes/mihoyo/zzz/news.ts +106 -0
- package/lib/routes/missav/new.ts +2 -1
- package/lib/routes/mit/hanlab.ts +61 -0
- package/lib/routes/mit/namespace.ts +6 -0
- package/lib/routes/mittrchina/index.ts +3 -3
- package/lib/routes/mixcloud/config.ts +129 -0
- package/lib/routes/mixcloud/index.ts +163 -107
- package/lib/routes/mixcloud/user-playlist.ts +31 -0
- package/lib/routes/mixi2/community.ts +72 -0
- package/lib/routes/mixi2/discovery.ts +52 -0
- package/lib/routes/mixi2/home.ts +51 -0
- package/lib/routes/mixi2/namespace.ts +8 -0
- package/lib/routes/mixi2/user.ts +77 -0
- package/lib/routes/mixi2/utils.ts +56 -0
- package/lib/routes/modelscope/learn.ts +94 -0
- package/lib/routes/moodysmismicrosite/report.ts +1 -1
- package/lib/routes/musify/index.ts +130 -0
- package/lib/routes/musify/namespace.ts +9 -0
- package/lib/routes/musikguru/namespace.ts +9 -0
- package/lib/routes/musikguru/news.ts +146 -0
- package/lib/routes/musikguru/templates/description.art +21 -0
- package/lib/routes/myfans/post.ts +1 -0
- package/lib/routes/nankai/cc-notice.ts +114 -0
- package/lib/routes/nankai/jwc.ts +131 -0
- package/lib/routes/nankai/namespace.ts +7 -0
- package/lib/routes/nankai/notice.ts +84 -0
- package/lib/routes/nankai/yzb.ts +97 -0
- package/lib/routes/neu/yz.ts +172 -0
- package/lib/routes/newslaundry/explainer.ts +30 -0
- package/lib/routes/newslaundry/namespace.ts +8 -0
- package/lib/routes/newslaundry/nl-cheatsheet.ts +30 -0
- package/lib/routes/newslaundry/nl-collaborations.ts +30 -0
- package/lib/routes/newslaundry/podcast.ts +61 -0
- package/lib/routes/newslaundry/reports.ts +30 -0
- package/lib/routes/newslaundry/shot.ts +30 -0
- package/lib/routes/newslaundry/subscriber-only.ts +30 -0
- package/lib/routes/newslaundry/templates/description.art +28 -0
- package/lib/routes/newslaundry/utils.ts +108 -0
- package/lib/routes/newswav/latest.ts +100 -0
- package/lib/routes/newswav/namespace.ts +7 -0
- package/lib/routes/nhentai/index.ts +1 -0
- package/lib/routes/nifd/research.ts +16 -0
- package/lib/routes/nio/namespace.ts +9 -0
- package/lib/routes/nio/nioradio.ts +75 -0
- package/lib/routes/njust/cs.ts +58 -0
- package/lib/routes/njust/utils.ts +1 -1
- package/lib/routes/ntdm/video.ts +1 -1
- package/lib/routes/nuaa/utils/pypasswaf.ts +1 -1
- package/lib/routes/oilchem/index.ts +1 -1
- package/lib/routes/oncc/money18.ts +1 -1
- package/lib/routes/openai/cookbook.ts +1 -1
- package/lib/routes/paulgraham/article.ts +2 -2
- package/lib/routes/picuki/profile.ts +4 -0
- package/lib/routes/pixiv/bookmarks.ts +1 -1
- package/lib/routes/pixiv/novel-api/series/sfw.ts +1 -1
- package/lib/routes/pixiv/novels.ts +2 -2
- package/lib/routes/pixiv/user.ts +1 -1
- package/lib/routes/playno1/av.ts +1 -0
- package/lib/routes/pornhub/model.ts +3 -7
- package/lib/routes/pornhub/pornstar.ts +2 -7
- package/lib/routes/pornhub/users.ts +2 -7
- package/lib/routes/pornhub/utils.ts +12 -1
- package/lib/routes/qingting/podcast.ts +2 -1
- package/lib/routes/qipamaijia/index.ts +1 -0
- package/lib/routes/questmobile/report.ts +1 -1
- package/lib/routes/railway/index.ts +73 -0
- package/lib/routes/railway/namespace.ts +8 -0
- package/lib/routes/reuters/common.ts +0 -3
- package/lib/routes/rockthejvm/articles.ts +167 -0
- package/lib/routes/rockthejvm/namespace.ts +9 -0
- package/lib/routes/rockthejvm/templates/description.art +7 -0
- package/lib/routes/samrdprc/namespace.ts +7 -0
- package/lib/routes/samrdprc/news.ts +79 -0
- package/lib/routes/sankei/namespace.ts +7 -0
- package/lib/routes/sankei/news.ts +68 -0
- package/lib/routes/sankei/topics.ts +71 -0
- package/lib/routes/sciencenet/user.ts +1 -1
- package/lib/routes/scoop/apps.ts +188 -0
- package/lib/routes/scoop/namespace.ts +9 -0
- package/lib/routes/scoop/templates/description.art +56 -0
- package/lib/routes/scpta/namespace.ts +8 -0
- package/lib/routes/scpta/news.ts +101 -0
- package/lib/routes/seekingalpha/index.ts +1 -1
- package/lib/routes/sehuatang/index.ts +29 -31
- package/lib/routes/setn/index.ts +11 -2
- package/lib/routes/seu/cyber/index.ts +78 -0
- package/lib/routes/sicau/jiaowu.ts +42 -34
- package/lib/routes/sis001/forum.ts +1 -0
- package/lib/routes/sjtu/seiee/icisee.ts +67 -0
- package/lib/routes/sketis/isabelle-dev/blog/index.ts +1 -1
- package/lib/routes/smartlink/index.ts +13 -3
- package/lib/routes/sohu/mp.ts +17 -6
- package/lib/routes/sotwe/namespace.ts +1 -0
- package/lib/routes/sotwe/user.ts +98 -0
- package/lib/routes/spankbang/new-videos.ts +1 -0
- package/lib/routes/spglobal/ratings.ts +1 -1
- package/lib/routes/stanford/blog.ts +77 -0
- package/lib/routes/stanford/namespace.ts +7 -0
- package/lib/routes/syosetu/index.ts +1 -1
- package/lib/routes/t66y/index.ts +1 -0
- package/lib/routes/taobao/mysql.ts +157 -0
- package/lib/routes/taobao/namespace.ts +2 -2
- package/lib/routes/techcrunch/category.ts +48 -0
- package/lib/routes/telegram/channel.ts +2 -2
- package/lib/routes/tesla/cx.ts +1 -1
- package/lib/routes/test/index.ts +1 -1
- package/lib/routes/themoviedb/episodes.ts +1 -1
- package/lib/routes/thewirehindi/category.ts +78 -0
- package/lib/routes/thewirehindi/index.ts +43 -0
- package/lib/routes/thewirehindi/namespace.ts +7 -0
- package/lib/routes/thewirehindi/templates/description.art +9 -0
- package/lib/routes/thewirehindi/utils.ts +33 -0
- package/lib/routes/threads/utils.ts +2 -2
- package/lib/routes/tidb/blog.ts +314 -0
- package/lib/routes/tidb/namespace.ts +9 -0
- package/lib/routes/tumblr/namespace.ts +17 -0
- package/lib/routes/tumblr/posts.ts +74 -0
- package/lib/routes/tumblr/utils.ts +110 -0
- package/lib/routes/tver/namespace.ts +7 -0
- package/lib/routes/tver/series.ts +98 -0
- package/lib/routes/twitter/api/web-api/login.ts +1 -3
- package/lib/routes/twitter/api/web-api/utils.ts +23 -1
- package/lib/routes/twitter/utils.ts +21 -21
- package/lib/routes/udn/breaking-news.ts +2 -2
- package/lib/routes/uestc/auto.ts +1 -1
- package/lib/routes/uestc/cqe.ts +1 -1
- package/lib/routes/uestc/scse.ts +1 -1
- package/lib/routes/uestc/sice.ts +1 -1
- package/lib/routes/uestc/sise.ts +1 -1
- package/lib/routes/upc/jwc.ts +32 -46
- package/lib/routes/uptimerobot/rss.ts +1 -1
- package/lib/routes/visionias/daily-news-summary.ts +65 -0
- package/lib/routes/visionias/monthly-magazine.ts +68 -0
- package/lib/routes/visionias/news-today.ts +3 -13
- package/lib/routes/visionias/utils.ts +5 -5
- package/lib/routes/visionias/weekly-focus.ts +2 -2
- package/lib/routes/wdfxw/bookfree.ts +528 -0
- package/lib/routes/wdfxw/namespace.ts +8 -0
- package/lib/routes/wdfxw/templates/description.art +13 -0
- package/lib/routes/whu/swrh.ts +1 -1
- package/lib/routes/windsurf/blog.ts +118 -0
- package/lib/routes/windsurf/changelog.ts +100 -0
- package/lib/routes/windsurf/namespace.ts +9 -0
- package/lib/routes/windsurf/templates/description.art +21 -0
- package/lib/routes/x6d/index.ts +1 -1
- package/lib/routes/xbookcn/blog.ts +1 -0
- package/lib/routes/xiaohongshu/util.ts +1 -3
- package/lib/routes/xiaoyuzhou/pickup.ts +1 -1
- package/lib/routes/ximalaya/album.ts +32 -70
- package/lib/routes/ximalaya/types.ts +48 -0
- package/lib/routes/ximalaya/utils.ts +9 -7
- package/lib/routes/xmanhua/index.ts +1 -0
- package/lib/routes/xueqiu/cookies.ts +1 -1
- package/lib/routes/xueqiu/user.ts +1 -1
- package/lib/routes/xwenming/index.ts +184 -0
- package/lib/routes/xwenming/namespace.ts +9 -0
- package/lib/routes/yahoo/news/utils.ts +1 -1
- package/lib/routes/yande/post.ts +3 -0
- package/lib/routes/ymgal/game.ts +1 -0
- package/lib/routes/youtube/api/google.ts +27 -0
- package/lib/routes/youtube/api/youtubei.ts +70 -20
- package/lib/routes/youtube/community.ts +3 -1
- package/lib/routes/youtube/utils.ts +16 -14
- package/lib/routes/zaobao/util.ts +8 -5
- package/lib/routes/zhihu/activities.ts +3 -0
- package/lib/routes/zhihu/execlib/x-zse-96-v3.ts +5 -5
- package/lib/routes/zhizhuan100/namespace.ts +7 -0
- package/lib/routes/zhizhuan100/report.ts +79 -0
- package/lib/routes/zimuxia/portfolio.ts +1 -1
- package/lib/routes/zju/sis/index.ts +161 -0
- package/lib/server.ts +5 -0
- package/lib/types.ts +58 -54
- package/lib/utils/helpers.ts +1 -1
- package/lib/utils/logger.ts +1 -1
- package/lib/utils/proxy/index.ts +102 -18
- package/lib/utils/proxy/multi-proxy.ts +139 -0
- package/lib/utils/proxy/unify-proxy.ts +3 -1
- package/lib/utils/puppeteer-utils.test.ts +1 -1
- package/lib/utils/puppeteer.test.ts +14 -27
- package/lib/utils/puppeteer.ts +51 -37
- package/lib/utils/readable-social.test.ts +65 -0
- package/lib/utils/readable-social.ts +15 -1
- package/lib/utils/request-rewriter/fetch.ts +42 -4
- package/package.json +54 -56
- package/lib/routes/mixcloud/queries.ts +0 -2274
- package/lib/routes-deprecated/dev.to/top.js +0 -40
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { type Data, type DataItem, type Route, ViewType } from '@/types';
|
|
2
|
+
|
|
3
|
+
import ofetch from '@/utils/ofetch';
|
|
4
|
+
import { parseDate } from '@/utils/parse-date';
|
|
5
|
+
|
|
6
|
+
import { type CheerioAPI, load } from 'cheerio';
|
|
7
|
+
import { type Context } from 'hono';
|
|
8
|
+
|
|
9
|
+
export const handler = async (ctx: Context): Promise<Data> => {
|
|
10
|
+
const limit: number = Number.parseInt(ctx.req.query('limit') ?? '30', 10);
|
|
11
|
+
|
|
12
|
+
const baseUrl: string = 'https://download.lineageos.org';
|
|
13
|
+
const targetUrl: string = new URL('changes', baseUrl).href;
|
|
14
|
+
const apiUrl: string = new URL('api/v2/changes', baseUrl).href;
|
|
15
|
+
|
|
16
|
+
const targetResponse = await ofetch(targetUrl);
|
|
17
|
+
const $: CheerioAPI = load(targetResponse);
|
|
18
|
+
const language = $('html').attr('lang') ?? 'en';
|
|
19
|
+
|
|
20
|
+
const response = await ofetch(apiUrl);
|
|
21
|
+
|
|
22
|
+
const items: DataItem[] = response.slice(0, limit).map((item): DataItem => {
|
|
23
|
+
const title: string = item.subject;
|
|
24
|
+
const pubDate: number | string = item.submitted;
|
|
25
|
+
const linkUrl: string | undefined = item.url;
|
|
26
|
+
const categories: string[] = [item.type, item.branch, item.repository];
|
|
27
|
+
const updated: number | string = item.updated;
|
|
28
|
+
|
|
29
|
+
const processedItem: DataItem = {
|
|
30
|
+
title,
|
|
31
|
+
pubDate: pubDate ? parseDate(pubDate, 'X') : undefined,
|
|
32
|
+
link: linkUrl,
|
|
33
|
+
category: categories,
|
|
34
|
+
updated: updated ? parseDate(updated, 'X') : undefined,
|
|
35
|
+
language,
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return processedItem;
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
return {
|
|
42
|
+
title: `${$('title').text()} - Downloads`,
|
|
43
|
+
description: undefined,
|
|
44
|
+
link: targetUrl,
|
|
45
|
+
item: items,
|
|
46
|
+
allowEmpty: true,
|
|
47
|
+
author: $('title').text(),
|
|
48
|
+
language,
|
|
49
|
+
id: targetUrl,
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const route: Route = {
|
|
54
|
+
path: '/changes',
|
|
55
|
+
name: 'Changes',
|
|
56
|
+
url: 'download.lineageos.org',
|
|
57
|
+
maintainers: ['nczitzk'],
|
|
58
|
+
handler,
|
|
59
|
+
example: '/lineageos/changes',
|
|
60
|
+
parameters: undefined,
|
|
61
|
+
description: undefined,
|
|
62
|
+
categories: ['program-update'],
|
|
63
|
+
features: {
|
|
64
|
+
requireConfig: false,
|
|
65
|
+
requirePuppeteer: false,
|
|
66
|
+
antiCrawler: false,
|
|
67
|
+
supportRadar: true,
|
|
68
|
+
supportBT: false,
|
|
69
|
+
supportPodcast: false,
|
|
70
|
+
supportScihub: false,
|
|
71
|
+
},
|
|
72
|
+
radar: [
|
|
73
|
+
{
|
|
74
|
+
source: ['download.lineageos.org/changes'],
|
|
75
|
+
target: '/changes',
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
view: ViewType.Notifications,
|
|
79
|
+
};
|
|
@@ -75,7 +75,7 @@ class Ucs2Text {
|
|
|
75
75
|
? this.codePoints
|
|
76
76
|
.map((a) => {
|
|
77
77
|
let b = '';
|
|
78
|
-
return 65535 < a && ((b += String.fromCharCode((((a -= 65536) >>> 10) & 1023) | 55296)), (a = 1023 & (56320 | a))), b + String.fromCharCode(a);
|
|
78
|
+
return (65535 < a && ((b += String.fromCharCode((((a -= 65536) >>> 10) & 1023) | 55296)), (a = 1023 & (56320 | a))), b + String.fromCharCode(a));
|
|
79
79
|
})
|
|
80
80
|
.join('')
|
|
81
81
|
: this.string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Route } from '@/types';
|
|
2
|
-
import
|
|
2
|
+
import ofetch from '@/utils/ofetch';
|
|
3
3
|
import { load } from 'cheerio';
|
|
4
4
|
|
|
5
5
|
export const route: Route = {
|
|
@@ -10,7 +10,8 @@ export const route: Route = {
|
|
|
10
10
|
target: '/counterstrike/matches/:id',
|
|
11
11
|
},
|
|
12
12
|
],
|
|
13
|
-
|
|
13
|
+
example: '/liquipedia/counterstrike/matches/Team_Falcons',
|
|
14
|
+
name: 'Counter-Strike Team Match Results',
|
|
14
15
|
maintainers: ['CookiePieWw'],
|
|
15
16
|
handler,
|
|
16
17
|
};
|
|
@@ -21,26 +22,53 @@ async function handler(ctx) {
|
|
|
21
22
|
const rootUrl = 'https://liquipedia.net';
|
|
22
23
|
const currentUrl = `${rootUrl}/counterstrike/${team}/Matches`;
|
|
23
24
|
|
|
24
|
-
const response = await
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
const response = await ofetch(currentUrl);
|
|
26
|
+
|
|
27
|
+
const $ = load(response);
|
|
28
|
+
const table = $('table').first();
|
|
29
|
+
const header = table.find('th');
|
|
30
|
+
const columnMap: { date?: number; tournament?: number; score?: number; opponent?: number } = {};
|
|
31
|
+
header.each((index, element) => {
|
|
32
|
+
const text = $(element).text().trim().toLowerCase();
|
|
33
|
+
if (text.includes('date')) {
|
|
34
|
+
columnMap.date = index;
|
|
35
|
+
}
|
|
36
|
+
if (text.includes('tournament')) {
|
|
37
|
+
columnMap.tournament = index;
|
|
38
|
+
}
|
|
39
|
+
if (text.includes('score')) {
|
|
40
|
+
columnMap.score = index;
|
|
41
|
+
}
|
|
42
|
+
if (text.includes('opponent')) {
|
|
43
|
+
columnMap.opponent = index;
|
|
44
|
+
}
|
|
27
45
|
});
|
|
28
46
|
|
|
29
|
-
const $ = load(response.data);
|
|
30
47
|
const list = $('.recent-matches-bg-lose, .recent-matches-bg-win');
|
|
31
48
|
|
|
32
49
|
const matches = list.toArray().map((item) => {
|
|
33
|
-
|
|
50
|
+
const html = $(item);
|
|
34
51
|
|
|
35
|
-
const getRes = () => (
|
|
52
|
+
const getRes = () => (html.attr('class') === 'recent-matches-bg-lose' ? 'LOSS' : 'WIN');
|
|
36
53
|
const result = getRes();
|
|
54
|
+
const infoList = html.find('td');
|
|
37
55
|
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
|
|
56
|
+
const time = infoList
|
|
57
|
+
.eq(columnMap.date ?? 0)
|
|
58
|
+
.text()
|
|
59
|
+
.trim();
|
|
60
|
+
const tournament = infoList
|
|
61
|
+
.eq(columnMap.tournament ?? 5)
|
|
62
|
+
.text()
|
|
63
|
+
.trim();
|
|
64
|
+
const score = infoList
|
|
65
|
+
.eq(columnMap.score ?? 7)
|
|
66
|
+
.text()
|
|
67
|
+
.trim();
|
|
68
|
+
const opponent = infoList
|
|
69
|
+
.eq(columnMap.opponent ?? 8)
|
|
70
|
+
.text()
|
|
71
|
+
.trim();
|
|
44
72
|
|
|
45
73
|
return {
|
|
46
74
|
title: `[${result}] ${team} ${score} ${opponent} on ${tournament}`,
|
package/lib/routes/lofter/tag.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Route } from '@/types';
|
|
2
2
|
import got from '@/utils/got';
|
|
3
|
+
import { config } from '@/config';
|
|
3
4
|
import { load } from 'cheerio';
|
|
4
5
|
import { parseDate } from '@/utils/parse-date';
|
|
5
6
|
import { JSDOM } from 'jsdom';
|
|
7
|
+
import ConfigNotFoundError from '@/errors/types/config-not-found';
|
|
6
8
|
|
|
7
9
|
export const route: Route = {
|
|
8
10
|
path: '/tag/:name?/:type?',
|
|
@@ -10,7 +12,16 @@ export const route: Route = {
|
|
|
10
12
|
example: '/lofter/tag/cosplay/date',
|
|
11
13
|
parameters: { name: 'tag name, such as `名侦探柯南`, `摄影` by default', type: 'ranking type, see below, new by default' },
|
|
12
14
|
features: {
|
|
13
|
-
requireConfig:
|
|
15
|
+
requireConfig: [
|
|
16
|
+
{
|
|
17
|
+
name: 'LOFTER_COOKIE',
|
|
18
|
+
description: `LOFTER_COOKIE: 用于搜索标签相关内容,获取方式:
|
|
19
|
+
1. 登录 Lofter 并搜索任一标签,进入页面 https://www.lofter.com/tag/*
|
|
20
|
+
2. 打开控制台,切换到 Network 面板,刷新
|
|
21
|
+
3. 点击 TagBean.seach.dwr 请求,找到 Cookie
|
|
22
|
+
4. 获取最新标签内容只要求 \`LOFTER_SESS\` 开始的字段`,
|
|
23
|
+
},
|
|
24
|
+
],
|
|
14
25
|
requirePuppeteer: false,
|
|
15
26
|
antiCrawler: false,
|
|
16
27
|
supportBT: false,
|
|
@@ -20,7 +31,11 @@ export const route: Route = {
|
|
|
20
31
|
name: 'Tag',
|
|
21
32
|
maintainers: ['hoilc', 'nczitzk', 'LucunJi'],
|
|
22
33
|
handler,
|
|
23
|
-
description:
|
|
34
|
+
description: `::: warning
|
|
35
|
+
搜索标签下的最新内容需要 Lofter 登录后的 Cookie 值,所以只能自建,详情见部署页面的配置模块。
|
|
36
|
+
:::
|
|
37
|
+
|
|
38
|
+
| new | date | week | month | total |
|
|
24
39
|
| ---- | ---- | ---- | ----- | ----- |
|
|
25
40
|
| 最新 | 日榜 | 周榜 | 月榜 | 总榜 |`,
|
|
26
41
|
};
|
|
@@ -33,7 +48,12 @@ async function handler(ctx) {
|
|
|
33
48
|
|
|
34
49
|
const rootUrl = 'https://www.lofter.com';
|
|
35
50
|
const linkUrl = `${rootUrl}/tag/${name}/${type}`;
|
|
36
|
-
const apiUrl = `${rootUrl}/dwr/call/plaincall/TagBean.
|
|
51
|
+
const apiUrl = `${rootUrl}/dwr/call/plaincall/TagBean.search.dwr`;
|
|
52
|
+
|
|
53
|
+
const cookie = config.lofter.cookies;
|
|
54
|
+
if (cookie === undefined) {
|
|
55
|
+
throw new ConfigNotFoundError('Lofter 用户登录后的 Cookie 值');
|
|
56
|
+
}
|
|
37
57
|
|
|
38
58
|
const response = await got({
|
|
39
59
|
method: 'post',
|
|
@@ -56,6 +76,10 @@ async function handler(ctx) {
|
|
|
56
76
|
'c0-param8': 'number:0',
|
|
57
77
|
batchId: 493053,
|
|
58
78
|
}),
|
|
79
|
+
headers: {
|
|
80
|
+
Referer: `https://www.lofter.com/tag/${encodeURI(name)}`,
|
|
81
|
+
Cookie: cookie,
|
|
82
|
+
},
|
|
59
83
|
});
|
|
60
84
|
|
|
61
85
|
const dom = new JSDOM(
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Route } from '@/types';
|
|
2
|
+
import ofetch from '@/utils/ofetch';
|
|
3
|
+
import { baseUrl, getNextBuildId } from './utils';
|
|
4
|
+
import { parseDate } from '@/utils/parse-date';
|
|
5
|
+
import { config } from '@/config';
|
|
6
|
+
|
|
7
|
+
export const route: Route = {
|
|
8
|
+
path: '/contests',
|
|
9
|
+
categories: ['design'],
|
|
10
|
+
example: '/makerworld/contests',
|
|
11
|
+
name: 'Contests',
|
|
12
|
+
maintainers: ['TonyRL'],
|
|
13
|
+
handler,
|
|
14
|
+
radar: [
|
|
15
|
+
{
|
|
16
|
+
source: ['makerworld.com/:lang/contests'],
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
async function handler() {
|
|
22
|
+
const nextBuildId = await getNextBuildId();
|
|
23
|
+
const response = await ofetch(`${baseUrl}/_next/data/${nextBuildId}/en/contests.json`, {
|
|
24
|
+
headers: {
|
|
25
|
+
'User-Agent': config.trueUA,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
const { listConst, previewList } = response.pageProps;
|
|
29
|
+
|
|
30
|
+
const items = [
|
|
31
|
+
...listConst.map((c) => ({
|
|
32
|
+
title: c.contestName,
|
|
33
|
+
link: `${baseUrl}/en/contests/${c.id}?name=${c.contestName}`,
|
|
34
|
+
description: c.themeDesc,
|
|
35
|
+
pubDate: parseDate(c.startTime),
|
|
36
|
+
})),
|
|
37
|
+
...previewList.map((p) => ({
|
|
38
|
+
title: p.contestTheme,
|
|
39
|
+
description: p.themeDesc,
|
|
40
|
+
pubDate: parseDate(p.contestTime),
|
|
41
|
+
})),
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
return {
|
|
45
|
+
title: 'Contest - MakerWorld',
|
|
46
|
+
description: 'Join the contest to showcase your creativity and win substantial rewards',
|
|
47
|
+
link: `${baseUrl}/en/contests`,
|
|
48
|
+
image: `${baseUrl}/favicon_new.png`,
|
|
49
|
+
item: items,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Route } from '@/types';
|
|
2
|
+
import ofetch from '@/utils/ofetch';
|
|
3
|
+
import { baseUrl, getNextBuildId } from './utils';
|
|
4
|
+
import { parseDate } from '@/utils/parse-date';
|
|
5
|
+
import { config } from '@/config';
|
|
6
|
+
|
|
7
|
+
export const route: Route = {
|
|
8
|
+
path: '/trending',
|
|
9
|
+
categories: ['design'],
|
|
10
|
+
example: '/makerworld/trending',
|
|
11
|
+
name: 'Trending Models',
|
|
12
|
+
maintainers: ['TonyRL'],
|
|
13
|
+
handler,
|
|
14
|
+
radar: [
|
|
15
|
+
{
|
|
16
|
+
source: ['makerworld.com/:lang'],
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
async function handler() {
|
|
22
|
+
const nextBuildId = await getNextBuildId();
|
|
23
|
+
const response = await ofetch(`${baseUrl}/_next/data/${nextBuildId}/en.json`, {
|
|
24
|
+
headers: {
|
|
25
|
+
'User-Agent': config.trueUA,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const items = response.pageProps.popularDesignsData.map((d) => ({
|
|
30
|
+
title: d.title,
|
|
31
|
+
link: `${baseUrl}/en/models/${d.id}-${d.slug}`,
|
|
32
|
+
author: d.designCreator.name,
|
|
33
|
+
category: d.tags,
|
|
34
|
+
pubDate: parseDate(d.startTime),
|
|
35
|
+
description: d.designExtension.design_pictures.map((i) => `<figure><img src="${i.url}" alt="${d.name}"><figcaption>${i.name}</figcaption></figure>`).join(''),
|
|
36
|
+
}));
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
title: 'Trending Models - MakerWorld',
|
|
40
|
+
description: 'Leading 3D printing model community for designers and makers. Download thousands of 3D models and stl models for free, and your No.1 option for multicolor 3D models',
|
|
41
|
+
link: `${baseUrl}/en`,
|
|
42
|
+
image: `${baseUrl}/favicon_new.png`,
|
|
43
|
+
item: items,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Route } from '@/types';
|
|
2
|
+
import ofetch from '@/utils/ofetch';
|
|
3
|
+
import { baseUrl, getNextBuildId } from './utils';
|
|
4
|
+
import { parseDate } from '@/utils/parse-date';
|
|
5
|
+
import { config } from '@/config';
|
|
6
|
+
|
|
7
|
+
export const route: Route = {
|
|
8
|
+
path: '/user/:handle/upload',
|
|
9
|
+
categories: ['design'],
|
|
10
|
+
example: '/makerworld/user/@Wcad00/upload',
|
|
11
|
+
parameters: {
|
|
12
|
+
handle: 'User handle',
|
|
13
|
+
},
|
|
14
|
+
name: 'User Uploads',
|
|
15
|
+
maintainers: ['TonyRL'],
|
|
16
|
+
handler,
|
|
17
|
+
radar: [
|
|
18
|
+
{
|
|
19
|
+
source: ['makerworld.com/:lang/:handle/upload', 'makerworld.com/:lang/:handle'],
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
async function handler(ctx) {
|
|
25
|
+
const { handle } = ctx.req.param();
|
|
26
|
+
|
|
27
|
+
const nextBuildId = await getNextBuildId();
|
|
28
|
+
const response = await ofetch(`${baseUrl}/_next/data/${nextBuildId}/en/${handle}/upload.json`, {
|
|
29
|
+
headers: {
|
|
30
|
+
'User-Agent': config.trueUA,
|
|
31
|
+
},
|
|
32
|
+
query: {
|
|
33
|
+
handle,
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
const { userInfo, designs } = response.pageProps;
|
|
37
|
+
|
|
38
|
+
const items = designs.map((d) => ({
|
|
39
|
+
title: d.title,
|
|
40
|
+
link: `${baseUrl}/en/models/${d.id}-${d.slug}`,
|
|
41
|
+
pubDate: parseDate(d.createTime),
|
|
42
|
+
author: d.designCreator.name,
|
|
43
|
+
category: d.tags,
|
|
44
|
+
description: d.instances.map((i) => `<figure><img src="${i.cover}" alt="${d.title}"><figcaption>${i.title}</figcaption></figure>`).join(''),
|
|
45
|
+
}));
|
|
46
|
+
|
|
47
|
+
return {
|
|
48
|
+
title: `${userInfo.name} | Published - MakerWorld`,
|
|
49
|
+
link: `${baseUrl}/en/${handle}/upload`,
|
|
50
|
+
description: userInfo.personal.bio,
|
|
51
|
+
image: userInfo.avatar,
|
|
52
|
+
item: items,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import ofetch from '@/utils/ofetch';
|
|
2
|
+
import cache from '@/utils/cache';
|
|
3
|
+
import { load } from 'cheerio';
|
|
4
|
+
import { config } from '@/config';
|
|
5
|
+
|
|
6
|
+
export const baseUrl = 'https://makerworld.com';
|
|
7
|
+
|
|
8
|
+
export const getNextBuildId = () =>
|
|
9
|
+
cache.tryGet('makerworld:nextBuildId', async () => {
|
|
10
|
+
const response = await ofetch(`${baseUrl}/en`, {
|
|
11
|
+
headers: {
|
|
12
|
+
'User-Agent': config.trueUA,
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
const $ = load(response);
|
|
16
|
+
const nextData = JSON.parse($('script#__NEXT_DATA__').text());
|
|
17
|
+
return nextData.buildId;
|
|
18
|
+
});
|
|
@@ -20,7 +20,7 @@ const getChapters = ($) => {
|
|
|
20
20
|
if (!nextEle) {
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
|
-
for (const ul of $(nextEle).children('ul').toArray().
|
|
23
|
+
for (const ul of $(nextEle).children('ul').toArray().toReversed()) {
|
|
24
24
|
for (const li of $(ul).children('li').toArray()) {
|
|
25
25
|
const a = $(li).children('a');
|
|
26
26
|
// 通过操作发布时间来对章节进行排序,如果是刚刚更新的单行本或者番外,保留最新更新时间
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Route, DataItem, Data, ViewType } from '@/types';
|
|
2
|
+
import cache from '@/utils/cache';
|
|
3
|
+
import ofetch from '@/utils/ofetch';
|
|
4
|
+
import { load } from 'cheerio';
|
|
5
|
+
|
|
6
|
+
export const route: Route = {
|
|
7
|
+
path: '/blog',
|
|
8
|
+
categories: ['programming'],
|
|
9
|
+
example: '/manus/blog',
|
|
10
|
+
url: 'manus.im',
|
|
11
|
+
parameters: {},
|
|
12
|
+
features: {
|
|
13
|
+
requireConfig: false,
|
|
14
|
+
requirePuppeteer: false,
|
|
15
|
+
antiCrawler: false,
|
|
16
|
+
supportBT: false,
|
|
17
|
+
supportPodcast: false,
|
|
18
|
+
supportScihub: false,
|
|
19
|
+
},
|
|
20
|
+
radar: [
|
|
21
|
+
{
|
|
22
|
+
source: ['www.manus.im'],
|
|
23
|
+
target: '/blog',
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
name: 'Blog',
|
|
27
|
+
maintainers: ['cscnk52'],
|
|
28
|
+
handler,
|
|
29
|
+
description: 'Manus Blog',
|
|
30
|
+
view: ViewType.Notifications,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
async function handler() {
|
|
34
|
+
const rootUrl = 'https://manus.im/blog';
|
|
35
|
+
|
|
36
|
+
const response = await ofetch(rootUrl);
|
|
37
|
+
const $ = load(response);
|
|
38
|
+
|
|
39
|
+
const list: DataItem[] = $('div.mt-10.px-6 > a')
|
|
40
|
+
.toArray()
|
|
41
|
+
.map((item) => {
|
|
42
|
+
const element = $(item);
|
|
43
|
+
const link = new URL(String(element.attr('href')), rootUrl).href;
|
|
44
|
+
const title = String(element.find('h2').attr('title'));
|
|
45
|
+
|
|
46
|
+
return {
|
|
47
|
+
link,
|
|
48
|
+
title,
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const items: DataItem[] = await Promise.all(
|
|
53
|
+
list.map((item) =>
|
|
54
|
+
cache.tryGet(String(item.link), async () => {
|
|
55
|
+
const response = await ofetch(String(item.link));
|
|
56
|
+
const $ = load(response);
|
|
57
|
+
const description: string = $('div.relative:nth-child(3)').html() ?? '';
|
|
58
|
+
const pubDateText: string = $('div.gap-3:nth-child(1) > span:nth-child(2)').text().trim();
|
|
59
|
+
const currentYear: number = new Date().getFullYear();
|
|
60
|
+
const pubDate: Date = new Date(`${pubDateText} ${currentYear}`);
|
|
61
|
+
|
|
62
|
+
return {
|
|
63
|
+
...item,
|
|
64
|
+
description,
|
|
65
|
+
pubDate,
|
|
66
|
+
};
|
|
67
|
+
})
|
|
68
|
+
)
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
return {
|
|
72
|
+
title: 'Manus',
|
|
73
|
+
link: rootUrl,
|
|
74
|
+
item: items,
|
|
75
|
+
language: 'en',
|
|
76
|
+
} satisfies Data;
|
|
77
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Route, ViewType, Data } from '@/types';
|
|
2
|
+
|
|
3
|
+
import got from '@/utils/got';
|
|
4
|
+
import { Context } from 'hono';
|
|
5
|
+
import utils from './utils';
|
|
6
|
+
import { config } from '@/config';
|
|
7
|
+
import ConfigNotFoundError from '@/errors/types/config-not-found';
|
|
8
|
+
|
|
9
|
+
export const route: Route = {
|
|
10
|
+
path: '/tag/:site/:hashtag/:only_media?',
|
|
11
|
+
categories: ['social-media'],
|
|
12
|
+
view: ViewType.SocialMedia,
|
|
13
|
+
example: '/mastodon/tag/mastodon.social/gochisou/true',
|
|
14
|
+
parameters: {
|
|
15
|
+
site: 'instance address, only domain, no `http://` or `https://` protocol header',
|
|
16
|
+
hashtag: 'Hashtag you want to subscribe to (without the # symbol)',
|
|
17
|
+
only_media: {
|
|
18
|
+
description: 'whether only display media content, default to false, any value to true',
|
|
19
|
+
options: [
|
|
20
|
+
{ value: 'true', label: 'true' },
|
|
21
|
+
{ value: 'false', label: 'false' },
|
|
22
|
+
],
|
|
23
|
+
default: 'false',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
name: 'Hashtag timeline',
|
|
27
|
+
maintainers: ['yuikisaito'],
|
|
28
|
+
handler,
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
async function handler(ctx: Context): Promise<Data> {
|
|
32
|
+
const { site, hashtag } = ctx.req.param();
|
|
33
|
+
const only_media = ctx.req.param('only_media') === 'true' ? 'true' : 'false';
|
|
34
|
+
if (!config.feature.allow_user_supply_unsafe_domain && !utils.allowSiteList.includes(site)) {
|
|
35
|
+
throw new ConfigNotFoundError(`This RSS is disabled unless 'ALLOW_USER_SUPPLY_UNSAFE_DOMAIN' is set to 'true'.`);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const url = `http://${site}/api/v1/timelines/tag/${hashtag}?only_media=${only_media}`;
|
|
39
|
+
|
|
40
|
+
const response = await got.get(url, { headers: utils.apiHeaders(site) });
|
|
41
|
+
const list = response.data;
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
title: `#${hashtag} ${only_media === 'true' ? ' Media' : ''} Timeline on ${site}`,
|
|
45
|
+
link: `https://${site}`,
|
|
46
|
+
item: utils.parseStatuses(list),
|
|
47
|
+
};
|
|
48
|
+
}
|