rsshub 1.0.0-master.f9ec483 → 1.0.0-master.fa1dcc5

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.
Files changed (334) hide show
  1. package/lib/config.ts +42 -1
  2. package/lib/middleware/access-control.ts +3 -3
  3. package/lib/middleware/cache.ts +5 -3
  4. package/lib/middleware/template.test.ts +6 -0
  5. package/lib/middleware/template.tsx +3 -1
  6. package/lib/router.js +0 -6
  7. package/lib/routes/141jav/index.ts +1 -1
  8. package/lib/routes/141ppv/index.ts +1 -1
  9. package/lib/routes/36kr/hot-list.ts +1 -1
  10. package/lib/routes/36kr/index.ts +1 -1
  11. package/lib/routes/78dm/index.ts +429 -43
  12. package/lib/routes/78dm/namespace.ts +2 -0
  13. package/lib/routes/78dm/templates/description.art +17 -0
  14. package/lib/routes/abc/index.ts +10 -9
  15. package/lib/routes/aeon/category.ts +1 -1
  16. package/lib/routes/aeon/type.ts +1 -1
  17. package/lib/routes/afr/latest.ts +69 -0
  18. package/lib/routes/afr/namespace.ts +7 -0
  19. package/lib/routes/afr/navigation.ts +75 -0
  20. package/lib/routes/afr/query.ts +349 -0
  21. package/lib/routes/afr/utils.ts +80 -0
  22. package/lib/routes/aibase/discover.ts +1 -1
  23. package/lib/routes/aibase/news.ts +1 -1
  24. package/lib/routes/aibase/topic.ts +1 -1
  25. package/lib/routes/air-level/index.ts +49 -0
  26. package/lib/routes/air-level/levelrank.ts +65 -0
  27. package/lib/routes/air-level/namespace.ts +12 -0
  28. package/lib/routes/ajcass/namespace.ts +11 -0
  29. package/lib/routes/ajcass/shxyj.ts +73 -0
  30. package/lib/routes/alpinelinux/pkgs.ts +2 -2
  31. package/lib/routes/anime1/anime.ts +1 -1
  32. package/lib/routes/apnews/utils.ts +6 -2
  33. package/lib/routes/appleinsider/index.ts +1 -1
  34. package/lib/routes/aqara/region.ts +1 -1
  35. package/lib/routes/asus/bios.ts +0 -1
  36. package/lib/routes/baoyu/index.ts +57 -0
  37. package/lib/routes/baoyu/namespace.ts +8 -0
  38. package/lib/routes/bilibili/article.ts +37 -14
  39. package/lib/routes/bilibili/dynamic.ts +15 -7
  40. package/lib/routes/bilibili/followings-dynamic.ts +2 -2
  41. package/lib/routes/bilibili/manga-update.ts +3 -0
  42. package/lib/routes/bilibili/ranking.ts +188 -117
  43. package/lib/routes/bilibili/reply.ts +2 -0
  44. package/lib/routes/bilibili/templates/description.art +2 -0
  45. package/lib/routes/bing/daily-wallpaper.ts +5 -1
  46. package/lib/routes/bsky/posts.ts +0 -1
  47. package/lib/routes/bsky/templates/post.art +8 -1
  48. package/lib/routes/buaa/lib/space/newbook.ts +1 -1
  49. package/lib/routes/c114/namespace.ts +2 -0
  50. package/lib/routes/c114/roll.ts +71 -42
  51. package/lib/routes/cags/edu/index.ts +84 -0
  52. package/lib/routes/cags/namespace.ts +9 -0
  53. package/lib/routes/caixin/article.ts +1 -1
  54. package/lib/routes/caixin/blog.ts +2 -3
  55. package/lib/routes/caixin/category.ts +1 -1
  56. package/lib/routes/caixin/latest.ts +12 -16
  57. package/lib/routes/caixin/namespace.ts +1 -1
  58. package/lib/routes/caixin/utils-fulltext.ts +51 -0
  59. package/lib/routes/caixin/utils.ts +37 -37
  60. package/lib/routes/cara/likes.ts +1 -1
  61. package/lib/routes/cara/portfolio.ts +1 -1
  62. package/lib/routes/cara/timeline.ts +1 -1
  63. package/lib/routes/ccfa/index.ts +11 -11
  64. package/lib/routes/chub/characters.ts +1 -1
  65. package/lib/routes/cnbeta/namespace.ts +1 -1
  66. package/lib/routes/cngold/index.ts +195 -0
  67. package/lib/routes/cngold/namespace.ts +9 -0
  68. package/lib/routes/cnki/author.ts +120 -48
  69. package/lib/routes/cnki/utils.ts +4 -4
  70. package/lib/routes/coomer/artist.ts +1 -1
  71. package/lib/routes/coomer/namespace.ts +1 -1
  72. package/lib/routes/coomer/posts.ts +2 -2
  73. package/lib/routes/coomer/utils.ts +1 -1
  74. package/lib/routes/cpcaauto/index.ts +22 -22
  75. package/lib/routes/cs/zzkx.ts +1 -1
  76. package/lib/routes/csdn/blog.ts +17 -13
  77. package/lib/routes/cybersecurityventures/namespace.ts +7 -0
  78. package/lib/routes/cybersecurityventures/news.ts +121 -0
  79. package/lib/routes/cybersecurityventures/types.ts +17 -0
  80. package/lib/routes/daily/discussed.ts +22 -21
  81. package/lib/routes/daily/index.ts +14 -11
  82. package/lib/routes/daily/namespace.ts +1 -1
  83. package/lib/routes/daily/source.ts +186 -0
  84. package/lib/routes/daily/upvoted.ts +17 -17
  85. package/lib/routes/daily/user.ts +6 -23
  86. package/lib/routes/daily/utils.ts +27 -32
  87. package/lib/routes/dataguidance/index.ts +19 -30
  88. package/lib/routes/dcfever/news.ts +1 -1
  89. package/lib/routes/dcfever/reviews.ts +1 -1
  90. package/lib/routes/dcfever/trading-search.ts +1 -1
  91. package/lib/routes/dcfever/trading.ts +1 -1
  92. package/lib/routes/deeplearning/namespace.ts +3 -1
  93. package/lib/routes/deeplearning/templates/description.art +21 -0
  94. package/lib/routes/deeplearning/the-batch.ts +296 -0
  95. package/lib/routes/deepmind/blog.ts +1 -1
  96. package/lib/routes/digitalcameraworld/news.ts +1 -1
  97. package/lib/routes/discord/discord-api.ts +44 -2
  98. package/lib/routes/discord/search.ts +106 -0
  99. package/lib/routes/dn/news.ts +1 -1
  100. package/lib/routes/dockerhub/repositories.ts +42 -0
  101. package/lib/routes/dongqiudi/daily.ts +1 -1
  102. package/lib/routes/dw/namespace.ts +6 -0
  103. package/lib/routes/dw/news.ts +89 -0
  104. package/lib/routes/dw/rss.ts +62 -0
  105. package/lib/routes/dw/templates/description.art +23 -0
  106. package/lib/routes/dw/templates/liveblog.art +13 -0
  107. package/lib/routes/dw/templates/video.art +14 -0
  108. package/lib/routes/dw/utils.ts +172 -0
  109. package/lib/routes/ecnu/jwc.ts +5 -1
  110. package/lib/routes/espn/news.ts +1 -1
  111. package/lib/routes/fashionnetwork/namespace.ts +1 -1
  112. package/lib/routes/flyert/forum.ts +99 -0
  113. package/lib/routes/flyert/namespace.ts +1 -0
  114. package/lib/routes/flyert/templates/description.art +21 -0
  115. package/lib/routes/flyert/util.ts +188 -0
  116. package/lib/routes/follow/profile.ts +2 -2
  117. package/lib/routes/foresightnews/article.ts +1 -1
  118. package/lib/routes/foresightnews/column.ts +1 -1
  119. package/lib/routes/foresightnews/index.ts +3 -1
  120. package/lib/routes/foresightnews/news.ts +1 -1
  121. package/lib/routes/freecomputerbooks/index.ts +0 -10
  122. package/lib/routes/ftm/index.ts +1 -1
  123. package/lib/routes/furaffinity/art.ts +85 -0
  124. package/lib/routes/furaffinity/browse.ts +58 -0
  125. package/lib/routes/furaffinity/commissions.ts +55 -0
  126. package/lib/routes/furaffinity/home.ts +80 -0
  127. package/lib/routes/furaffinity/journal-comments.ts +64 -0
  128. package/lib/routes/furaffinity/journals.ts +56 -0
  129. package/lib/routes/furaffinity/namespace.ts +7 -0
  130. package/lib/routes/furaffinity/search.ts +72 -0
  131. package/lib/routes/furaffinity/shouts.ts +56 -0
  132. package/lib/routes/furaffinity/status.ts +58 -0
  133. package/lib/routes/furaffinity/submission-comments.ts +64 -0
  134. package/lib/{routes-deprecated/furaffinity/user.js → routes/furaffinity/user.ts} +53 -41
  135. package/lib/routes/furaffinity/watchers.ts +62 -0
  136. package/lib/routes/furaffinity/watching.ts +62 -0
  137. package/lib/routes/google/developers.ts +71 -0
  138. package/lib/routes/google/news.ts +26 -6
  139. package/lib/routes/gov/cbirc/index.ts +35 -35
  140. package/lib/routes/hamel/index.ts +81 -0
  141. package/lib/routes/hamel/namespace.ts +7 -0
  142. package/lib/routes/hellogithub/volume.ts +3 -0
  143. package/lib/routes/hket/index.ts +13 -1
  144. package/lib/routes/hostmonit/cloudflareyesv6.ts +1 -1
  145. package/lib/routes/hrbeu/sec/list.ts +80 -0
  146. package/lib/routes/hrbust/jwzx.ts +6 -0
  147. package/lib/routes/hunau/gfxy/index.ts +1 -1
  148. package/lib/routes/hunau/ied.ts +1 -1
  149. package/lib/routes/hunau/jwc.ts +1 -1
  150. package/lib/routes/hunau/xky/index.ts +1 -1
  151. package/lib/routes/hust/gs.ts +4 -3
  152. package/lib/routes/idolmaster/namespace.ts +7 -0
  153. package/lib/routes/idolmaster/news.ts +112 -0
  154. package/lib/routes/ieee/author.ts +95 -0
  155. package/lib/routes/ikea/cn/low-price.ts +2 -1
  156. package/lib/routes/imdb/chart.ts +1 -1
  157. package/lib/routes/inspirehep/author.ts +9 -1
  158. package/lib/routes/isct/namespace.ts +11 -0
  159. package/lib/routes/isct/news.ts +66 -0
  160. package/lib/routes/javtrailers/casts.ts +41 -0
  161. package/lib/routes/javtrailers/categories.ts +40 -0
  162. package/lib/routes/javtrailers/namespace.ts +7 -0
  163. package/lib/routes/javtrailers/studios.ts +39 -0
  164. package/lib/routes/javtrailers/templates/description.art +31 -0
  165. package/lib/routes/javtrailers/types.ts +59 -0
  166. package/lib/routes/javtrailers/utils.ts +48 -0
  167. package/lib/routes/jiemian/list.ts +1 -1
  168. package/lib/routes/jiuyangongshe/community.ts +1 -1
  169. package/lib/routes/jlu/phy/index.ts +55 -0
  170. package/lib/routes/joins/chinese.ts +13 -13
  171. package/lib/routes/kcna/news.ts +7 -5
  172. package/lib/routes/keep/user.ts +1 -1
  173. package/lib/routes/langchain/index.ts +74 -0
  174. package/lib/routes/langchain/namespace.ts +7 -0
  175. package/lib/routes/last-origin/namespace.ts +7 -0
  176. package/lib/routes/last-origin/news.ts +65 -0
  177. package/lib/routes/linkresearcher/index.ts +108 -46
  178. package/lib/routes/linkresearcher/namespace.ts +8 -2
  179. package/lib/routes/linkresearcher/templates/bilingual.art +7 -0
  180. package/lib/routes/linkresearcher/types.ts +103 -0
  181. package/lib/routes/liulinblog/itnews.ts +1 -1
  182. package/lib/routes/lofter/collection.ts +1 -1
  183. package/lib/routes/lofter/tag.ts +1 -1
  184. package/lib/routes/logrocket/index.ts +71 -0
  185. package/lib/routes/logrocket/namespace.ts +7 -0
  186. package/lib/routes/m-78/namespace.ts +7 -0
  187. package/lib/routes/m-78/news.ts +115 -0
  188. package/lib/routes/m-78/types.ts +13 -0
  189. package/lib/routes/mastodon/account-id.ts +1 -1
  190. package/lib/routes/mastodon/acct.ts +1 -1
  191. package/lib/routes/mastodon/timeline-local.ts +2 -2
  192. package/lib/routes/mastodon/timeline-remote.ts +2 -2
  193. package/lib/routes/mastodon/utils.ts +1 -1
  194. package/lib/routes/metacritic/index.ts +1 -1
  195. package/lib/routes/mi/utils.ts +1 -1
  196. package/lib/routes/mihoyo/bbs/official.ts +2 -1
  197. package/lib/routes/misskey/utils.ts +19 -1
  198. package/lib/routes/mittrchina/index.ts +2 -2
  199. package/lib/routes/natgeo/natgeo.ts +25 -24
  200. package/lib/routes/nbd/daily.ts +1 -1
  201. package/lib/routes/nielsberglund/index.ts +78 -0
  202. package/lib/routes/nielsberglund/namespace.ts +7 -0
  203. package/lib/routes/nytimes/rss.ts +57 -0
  204. package/lib/routes/openrice/chart.ts +68 -0
  205. package/lib/routes/openrice/templates/chart.art +9 -0
  206. package/lib/routes/openrice/voting.ts +84 -0
  207. package/lib/routes/oschina/news.ts +26 -7
  208. package/lib/routes/patreon/feed.ts +126 -0
  209. package/lib/routes/patreon/namespace.ts +7 -0
  210. package/lib/routes/patreon/templates/description.art +39 -0
  211. package/lib/routes/patreon/types.ts +387 -0
  212. package/lib/routes/pixiv/api/get-illust-detail.ts +22 -0
  213. package/lib/routes/pixiv/novel-api/content/nsfw.ts +73 -0
  214. package/lib/routes/pixiv/novel-api/content/sfw.ts +63 -0
  215. package/lib/routes/pixiv/novel-api/content/types.ts +254 -0
  216. package/lib/routes/pixiv/novel-api/content/utils.ts +133 -0
  217. package/lib/routes/pixiv/novel-api/series/nsfw.ts +84 -0
  218. package/lib/routes/pixiv/novel-api/series/sfw.ts +70 -0
  219. package/lib/routes/pixiv/novel-api/series/types.ts +94 -0
  220. package/lib/routes/pixiv/novel-api/user-novels/nsfw.ts +82 -0
  221. package/lib/routes/pixiv/novel-api/user-novels/sfw.ts +74 -0
  222. package/lib/routes/pixiv/novel-api/user-novels/types.ts +133 -0
  223. package/lib/routes/pixiv/novel-series.ts +52 -0
  224. package/lib/routes/pixiv/novels.ts +69 -44
  225. package/lib/routes/pixiv/utils.ts +3 -0
  226. package/lib/routes/plurk/anonymous.ts +1 -1
  227. package/lib/routes/plurk/hotlinks.ts +1 -1
  228. package/lib/routes/plurk/news.ts +1 -1
  229. package/lib/routes/plurk/search.ts +1 -1
  230. package/lib/routes/qstheory/index.ts +121 -0
  231. package/lib/routes/qstheory/magazine.ts +64 -0
  232. package/lib/routes/qstheory/namespace.ts +7 -0
  233. package/lib/routes/qstheory/utils.ts +25 -0
  234. package/lib/routes/ruc/ai.ts +1 -1
  235. package/lib/routes/scmp/coronavirus.ts +1 -1
  236. package/lib/routes/scu/jwc/tzgg.ts +75 -0
  237. package/lib/routes/scu/namespace.ts +7 -0
  238. package/lib/routes/scu/scupi/_utils.ts +62 -0
  239. package/lib/routes/scu/scupi/notice.ts +41 -0
  240. package/lib/routes/solidot/namespace.ts +1 -1
  241. package/lib/routes/stbu/jsjxy.ts +4 -1
  242. package/lib/routes/steam/search.ts +7 -0
  243. package/lib/routes/sycl/feeds.ts +1 -1
  244. package/lib/routes/syosetu/dev.ts +67 -0
  245. package/lib/routes/syosetu/index.ts +85 -0
  246. package/lib/routes/syosetu/namespace.ts +2 -2
  247. package/lib/routes/syosetu/ranking-isekai.ts +93 -0
  248. package/lib/routes/syosetu/ranking-r18.ts +192 -0
  249. package/lib/routes/syosetu/ranking.ts +285 -0
  250. package/lib/routes/syosetu/search.ts +161 -0
  251. package/lib/routes/syosetu/templates/description.art +73 -0
  252. package/lib/routes/syosetu/types/ranking-r18.ts +60 -0
  253. package/lib/routes/syosetu/types/ranking.ts +67 -0
  254. package/lib/routes/syosetu/types/search.ts +138 -0
  255. package/lib/routes/syosetu/utils.ts +50 -0
  256. package/lib/routes/telegram/channel.ts +31 -1
  257. package/lib/routes/telegram/scripts/get-telegram-session.mjs +16 -6
  258. package/lib/routes/telegram/stickerpack.ts +1 -1
  259. package/lib/routes/telegram/tglib/channel.ts +12 -9
  260. package/lib/routes/telegram/tglib/client.ts +13 -9
  261. package/lib/routes/test/index.ts +4 -0
  262. package/lib/routes/theblockbeats/index.ts +1 -1
  263. package/lib/routes/thegradient/index.ts +80 -0
  264. package/lib/routes/thegradient/namespace.ts +7 -0
  265. package/lib/routes/theinitium/app.ts +4 -0
  266. package/lib/routes/thepaper/channel.ts +1 -1
  267. package/lib/routes/thepaper/factpaper.ts +1 -1
  268. package/lib/routes/thepaper/featured.ts +1 -1
  269. package/lib/routes/thepaper/list.ts +1 -1
  270. package/lib/routes/thepaper/user.ts +174 -0
  271. package/lib/routes/tongji/sem/_utils.ts +65 -0
  272. package/lib/routes/tongji/sem/notice.ts +58 -0
  273. package/lib/routes/toutiao/a-bogus.ts +540 -0
  274. package/lib/routes/toutiao/namespace.ts +7 -0
  275. package/lib/routes/toutiao/templates/video.art +7 -0
  276. package/lib/routes/toutiao/types.ts +443 -0
  277. package/lib/routes/toutiao/user.ts +127 -0
  278. package/lib/routes/twitter/api/mobile-api/api.ts +8 -0
  279. package/lib/routes/twitter/api/web-api/utils.ts +21 -9
  280. package/lib/routes/twitter/namespace.ts +1 -0
  281. package/lib/routes/twitter/utils.ts +7 -1
  282. package/lib/routes/vertikal/latest.ts +73 -0
  283. package/lib/routes/vertikal/namespace.ts +7 -0
  284. package/lib/routes/vice/topic.ts +1 -1
  285. package/lib/routes/vocus/publication.ts +1 -1
  286. package/lib/routes/vocus/user.ts +1 -1
  287. package/lib/routes/wallstreetcn/calendar.ts +90 -0
  288. package/lib/routes/wallstreetcn/hot.ts +2 -2
  289. package/lib/routes/wallstreetcn/live.ts +1 -1
  290. package/lib/routes/wallstreetcn/news.ts +5 -3
  291. package/lib/routes/weibo/timeline.ts +3 -2
  292. package/lib/routes/wellcee/rent.ts +1 -1
  293. package/lib/routes/wufazhuce/namespace.ts +7 -0
  294. package/lib/routes/wufazhuce/one.ts +90 -0
  295. package/lib/routes/xiaoheihe/discount.ts +72 -28
  296. package/lib/routes/xiaohongshu/user.ts +40 -3
  297. package/lib/routes/xiaohongshu/util.ts +112 -105
  298. package/lib/routes/xsijishe/rank.ts +33 -7
  299. package/lib/routes/xueqiu/cookies.ts +13 -18
  300. package/lib/routes/yahoo/news/listid.ts +4 -1
  301. package/lib/routes/yahoo/news/provider-helper.ts +4 -1
  302. package/lib/routes/yahoo/news/provider.ts +4 -1
  303. package/lib/routes/yande/post.ts +13 -3
  304. package/lib/routes/youtube/user.ts +37 -25
  305. package/lib/routes/zhonglun/index.ts +5 -6
  306. package/lib/routes/zjut/cs/index.ts +1 -1
  307. package/lib/utils/got.ts +2 -1
  308. package/lib/utils/helpers.test.ts +13 -1
  309. package/lib/utils/helpers.ts +10 -0
  310. package/lib/utils/ofetch.ts +3 -0
  311. package/lib/utils/request-rewriter/fetch.test.ts +94 -0
  312. package/lib/utils/request-rewriter/fetch.ts +14 -1
  313. package/lib/views/error.tsx +1 -1
  314. package/package.json +40 -37
  315. package/lib/routes/78dm/templates/image.art +0 -1
  316. package/lib/routes/deeplearning/thebatch.ts +0 -74
  317. package/lib/routes/syosetu/chapter.ts +0 -87
  318. package/lib/routes/xiaohongshu/notes.ts +0 -39
  319. package/lib/routes-deprecated/furaffinity/browse.js +0 -44
  320. package/lib/routes-deprecated/furaffinity/commissions.js +0 -39
  321. package/lib/routes-deprecated/furaffinity/favorites.js +0 -56
  322. package/lib/routes-deprecated/furaffinity/gallery.js +0 -56
  323. package/lib/routes-deprecated/furaffinity/home.js +0 -72
  324. package/lib/routes-deprecated/furaffinity/journal-comments.js +0 -50
  325. package/lib/routes-deprecated/furaffinity/journals.js +0 -49
  326. package/lib/routes-deprecated/furaffinity/scraps.js +0 -56
  327. package/lib/routes-deprecated/furaffinity/search.js +0 -56
  328. package/lib/routes-deprecated/furaffinity/shouts.js +0 -40
  329. package/lib/routes-deprecated/furaffinity/status.js +0 -38
  330. package/lib/routes-deprecated/furaffinity/submission-comments.js +0 -50
  331. package/lib/routes-deprecated/furaffinity/watchers.js +0 -47
  332. package/lib/routes-deprecated/furaffinity/watching.js +0 -47
  333. package/lib/routes-deprecated/ieee/author.js +0 -30
  334. package/lib/routes-deprecated/qstheory/index.js +0 -122
@@ -1,9 +1,5 @@
1
1
  import { Route } from '@/types';
2
- import { getData, getList, getRedirectedLink } from './utils.js';
3
-
4
- const variables = {
5
- first: 15,
6
- };
2
+ import { baseUrl, getData, getList } from './utils.js';
7
3
 
8
4
  const query = `
9
5
  query MostDiscussedFeed(
@@ -19,6 +15,7 @@ const query = `
19
15
  edges {
20
16
  node {
21
17
  ...FeedPost
18
+ contentHtml
22
19
  }
23
20
  }
24
21
  }
@@ -33,6 +30,7 @@ const query = `
33
30
  image
34
31
  readTime
35
32
  permalink
33
+ commentsPermalink
36
34
  summary
37
35
  createdAt
38
36
  numUpvotes
@@ -52,37 +50,40 @@ const query = `
52
50
  bio
53
51
  }
54
52
  `;
55
- const graphqlQuery = {
56
- query,
57
- variables,
58
- };
59
53
 
60
54
  export const route: Route = {
61
55
  path: '/discussed',
62
56
  example: '/daily/discussed',
63
57
  radar: [
64
58
  {
65
- source: ['daily.dev/popular'],
59
+ source: ['app.daily.dev/discussed'],
66
60
  },
67
61
  ],
68
62
  name: 'Most Discussed',
69
63
  maintainers: ['Rjnishant530'],
70
64
  handler,
71
- url: 'daily.dev/popular',
65
+ url: 'app.daily.dev/discussed',
72
66
  };
73
67
 
74
- async function handler() {
75
- const baseUrl = 'https://app.daily.dev/discussed';
76
- const data = await getData(graphqlQuery);
77
- const list = getList(data);
78
- const items = await getRedirectedLink(list);
68
+ async function handler(ctx) {
69
+ const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 20;
70
+ const link = `${baseUrl}/discussed`;
71
+
72
+ const data = await getData({
73
+ query,
74
+ variables: {
75
+ first: limit,
76
+ },
77
+ });
78
+ const items = getList(data);
79
+
79
80
  return {
80
- title: 'Most Discussed',
81
- link: baseUrl,
81
+ title: 'Real-time discussions in the developer community | daily.dev',
82
+ link,
82
83
  item: items,
83
- description: 'Most Discussed Posts on Daily.dev',
84
- logo: 'https://app.daily.dev/favicon-32x32.png',
85
- icon: 'https://app.daily.dev/favicon-32x32.png',
84
+ description: 'Stay on top of real-time developer discussions on daily.dev. Join conversations happening now and engage with the most active community members.',
85
+ logo: `${baseUrl}/favicon-32x32.png`,
86
+ icon: `${baseUrl}/favicon-32x32.png`,
86
87
  language: 'en-us',
87
88
  };
88
89
  }
@@ -1,5 +1,5 @@
1
1
  import { Route } from '@/types';
2
- import { getData, getList, getRedirectedLink } from './utils.js';
2
+ import { baseUrl, getData, getList } from './utils.js';
3
3
 
4
4
  const variables = {
5
5
  version: 11,
@@ -28,6 +28,7 @@ const query = `
28
28
  edges {
29
29
  node {
30
30
  ...FeedPost
31
+ contentHtml
31
32
  }
32
33
  }
33
34
  }
@@ -42,6 +43,7 @@ const query = `
42
43
  image
43
44
  readTime
44
45
  permalink
46
+ commentsPermalink
45
47
  summary
46
48
  createdAt
47
49
  numUpvotes
@@ -72,27 +74,28 @@ export const route: Route = {
72
74
  example: '/daily',
73
75
  radar: [
74
76
  {
75
- source: ['daily.dev/popular'],
77
+ source: ['app.daily.dev/popular'],
76
78
  },
77
79
  ],
78
80
  name: 'Popular',
79
81
  maintainers: ['Rjnishant530'],
80
82
  handler,
81
- url: 'daily.dev/popular',
83
+ url: 'app.daily.dev/popular',
82
84
  };
83
85
 
84
86
  async function handler() {
85
- const baseUrl = 'https://app.daily.dev/popular';
87
+ const link = `${baseUrl}/popular`;
88
+
86
89
  const data = await getData(graphqlQuery);
87
- const list = getList(data);
88
- const items = await getRedirectedLink(list);
90
+ const items = getList(data);
91
+
89
92
  return {
90
- title: 'Popular',
91
- link: baseUrl,
93
+ title: 'Popular posts on daily.dev',
94
+ link,
92
95
  item: items,
93
- description: 'Popular Posts on Daily.dev',
94
- logo: 'https://app.daily.dev/favicon-32x32.png',
95
- icon: 'https://app.daily.dev/favicon-32x32.png',
96
+ description: 'daily.dev is the easiest way to stay updated on the latest programming news. Get the best content from the top tech publications on any topic you want.',
97
+ logo: `${baseUrl}/favicon-32x32.png`,
98
+ icon: `${baseUrl}/favicon-32x32.png`,
96
99
  language: 'en-us',
97
100
  };
98
101
  }
@@ -2,7 +2,7 @@ import type { Namespace } from '@/types';
2
2
 
3
3
  export const namespace: Namespace = {
4
4
  name: 'Daily.dev',
5
- url: 'daily.dev',
5
+ url: 'app.daily.dev',
6
6
  categories: ['social-media'],
7
7
  lang: 'en',
8
8
  };
@@ -0,0 +1,186 @@
1
+ import { Route } from '@/types';
2
+ import { baseUrl, getBuildId, getData, getList } from './utils';
3
+ import ofetch from '@/utils/ofetch';
4
+ import cache from '@/utils/cache';
5
+ import { config } from '@/config';
6
+
7
+ interface Source {
8
+ id: string;
9
+ name: string;
10
+ handle: string;
11
+ image: string;
12
+ permalink: string;
13
+ description: string;
14
+ type: string;
15
+ }
16
+
17
+ const sourceFeedQuery = `
18
+ query SourceFeed($source: ID!, $loggedIn: Boolean! = false, $first: Int, $after: String, $ranking: Ranking, $supportedTypes: [String!]) {
19
+ page: sourceFeed(
20
+ source: $source
21
+ first: $first
22
+ after: $after
23
+ ranking: $ranking
24
+ supportedTypes: $supportedTypes
25
+ ) {
26
+ ...FeedPostConnection
27
+ }
28
+ }
29
+
30
+ fragment FeedPostConnection on PostConnection {
31
+ pageInfo {
32
+ hasNextPage
33
+ endCursor
34
+ }
35
+ edges {
36
+ node {
37
+ ...FeedPost
38
+ pinnedAt
39
+ contentHtml
40
+ ...UserPost @include(if: $loggedIn)
41
+ }
42
+ }
43
+ }
44
+
45
+ fragment FeedPost on Post {
46
+ ...FeedPostInfo
47
+ sharedPost {
48
+ id
49
+ title
50
+ image
51
+ readTime
52
+ permalink
53
+ commentsPermalink
54
+ createdAt
55
+ type
56
+ tags
57
+ source {
58
+ id
59
+ handle
60
+ permalink
61
+ image
62
+ }
63
+ slug
64
+ }
65
+ trending
66
+ feedMeta
67
+ collectionSources {
68
+ handle
69
+ image
70
+ }
71
+ numCollectionSources
72
+ updatedAt
73
+ slug
74
+ }
75
+
76
+ fragment FeedPostInfo on Post {
77
+ id
78
+ title
79
+ image
80
+ readTime
81
+ permalink
82
+ commentsPermalink
83
+ createdAt
84
+ commented
85
+ bookmarked
86
+ views
87
+ numUpvotes
88
+ numComments
89
+ summary
90
+ bookmark {
91
+ remindAt
92
+ }
93
+ author {
94
+ id
95
+ name
96
+ image
97
+ username
98
+ permalink
99
+ }
100
+ type
101
+ tags
102
+ source {
103
+ id
104
+ handle
105
+ name
106
+ permalink
107
+ image
108
+ type
109
+ }
110
+ userState {
111
+ vote
112
+ flags {
113
+ feedbackDismiss
114
+ }
115
+ }
116
+ slug
117
+ }
118
+
119
+ fragment UserPost on Post {
120
+ read
121
+ upvoted
122
+ commented
123
+ bookmarked
124
+ downvoted
125
+ }`;
126
+
127
+ export const route: Route = {
128
+ path: '/source/:sourceId',
129
+ example: '/daily/source/hn',
130
+ parameters: {
131
+ sourceId: 'The source id',
132
+ },
133
+ radar: [
134
+ {
135
+ source: ['app.daily.dev/sources/:sourceId'],
136
+ },
137
+ ],
138
+ name: 'Source Posts',
139
+ maintainers: ['TonyRL'],
140
+ handler,
141
+ url: 'app.daily.dev',
142
+ };
143
+
144
+ async function handler(ctx) {
145
+ const sourceId = ctx.req.param('sourceId');
146
+ const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 10;
147
+ const link = `${baseUrl}/sources/${sourceId}`;
148
+
149
+ const buildId = await getBuildId();
150
+
151
+ const userData = (await cache.tryGet(`daily:source:${sourceId}`, async () => {
152
+ const response = await ofetch(`${baseUrl}/_next/data/${buildId}/en/sources/${sourceId}.json`);
153
+ return response.pageProps.source;
154
+ })) as Source;
155
+
156
+ const items = await cache.tryGet(
157
+ `daily:source:${sourceId}:posts`,
158
+ async () => {
159
+ const edges = await getData({
160
+ query: sourceFeedQuery,
161
+ variables: {
162
+ source: sourceId,
163
+ supportedTypes: ['article', 'video:youtube', 'collection'],
164
+ period: 30,
165
+ first: limit,
166
+ after: '',
167
+ loggedIn: false,
168
+ },
169
+ });
170
+ return getList(edges);
171
+ },
172
+ config.cache.routeExpire,
173
+ false
174
+ );
175
+
176
+ return {
177
+ title: `${userData.name} posts on daily.dev`,
178
+ description: userData.description,
179
+ link,
180
+ item: items,
181
+ image: userData.image,
182
+ logo: userData.image,
183
+ icon: userData.image,
184
+ language: 'en-us',
185
+ };
186
+ }
@@ -1,5 +1,5 @@
1
1
  import { Route } from '@/types';
2
- import { getData, getList, getRedirectedLink } from './utils.js';
2
+ import { baseUrl, getData, getList } from './utils.js';
3
3
 
4
4
  const variables = {
5
5
  period: 7,
@@ -21,6 +21,7 @@ const query = `
21
21
  edges {
22
22
  node {
23
23
  ...FeedPost
24
+ contentHtml
24
25
  }
25
26
  }
26
27
  }
@@ -35,6 +36,7 @@ const query = `
35
36
  image
36
37
  readTime
37
38
  permalink
39
+ commentsPermalink
38
40
  summary
39
41
  createdAt
40
42
  numUpvotes
@@ -56,37 +58,35 @@ const query = `
56
58
 
57
59
  `;
58
60
 
59
- const graphqlQuery = {
60
- query,
61
- variables,
62
- };
63
-
64
61
  export const route: Route = {
65
62
  path: '/upvoted',
66
63
  example: '/daily/upvoted',
67
64
  radar: [
68
65
  {
69
- source: ['daily.dev/popular'],
66
+ source: ['app.daily.dev/upvoted'],
70
67
  },
71
68
  ],
72
69
  name: 'Most upvoted',
73
70
  maintainers: ['Rjnishant530'],
74
71
  handler,
75
- url: 'daily.dev/popular',
72
+ url: 'app.daily.dev/upvoted',
76
73
  };
77
74
 
78
75
  async function handler() {
79
- const baseUrl = 'https://app.daily.dev/upvoted';
80
- const data = await getData(graphqlQuery);
81
- const list = getList(data);
82
- const items = await getRedirectedLink(list);
76
+ const link = `${baseUrl}/upvoted`;
77
+ const data = await getData({
78
+ query,
79
+ variables,
80
+ });
81
+ const items = getList(data);
82
+
83
83
  return {
84
- title: 'Most Upvoted',
85
- link: baseUrl,
84
+ title: 'Most upvoted posts for developers | daily.dev',
85
+ link,
86
86
  item: items,
87
- description: 'Most Upvoted Posts on Daily.dev',
88
- logo: 'https://app.daily.dev/favicon-32x32.png',
89
- icon: 'https://app.daily.dev/favicon-32x32.png',
87
+ description: 'Find the most upvoted developer posts on daily.dev. Explore top-rated content in coding, tutorials, and tech news from the largest developer network in the world.',
88
+ logo: `${baseUrl}/favicon-32x32.png`,
89
+ icon: `${baseUrl}/favicon-32x32.png`,
90
90
  language: 'en-us',
91
91
  };
92
92
  }
@@ -1,13 +1,8 @@
1
1
  import { Route } from '@/types';
2
- import { baseUrl, getBuildId, getData } from './utils';
2
+ import { baseUrl, getBuildId, getData, getList } from './utils';
3
3
  import ofetch from '@/utils/ofetch';
4
4
  import cache from '@/utils/cache';
5
5
  import { config } from '@/config';
6
- import { parseDate } from '@/utils/parse-date';
7
- import { art } from '@/utils/render';
8
- import path from 'path';
9
- import { getCurrentPath } from '@/utils/helpers';
10
- const __dirname = getCurrentPath(import.meta.url);
11
6
 
12
7
  const userPostQuery = `
13
8
  query AuthorFeed(
@@ -155,20 +150,18 @@ const userPostQuery = `
155
150
  downvoted
156
151
  }`;
157
152
 
158
- const render = (data) => art(path.join(__dirname, 'templates/posts.art'), data);
159
-
160
153
  export const route: Route = {
161
154
  path: '/user/:userId',
162
155
  example: '/daily/user/kramer',
163
156
  radar: [
164
157
  {
165
- source: ['daily.dev/:userId/posts', 'daily.dev/:userId'],
158
+ source: ['app.daily.dev/:userId/posts', 'app.daily.dev/:userId'],
166
159
  },
167
160
  ],
168
161
  name: 'User Posts',
169
162
  maintainers: ['TonyRL'],
170
163
  handler,
171
- url: 'daily.dev',
164
+ url: 'app.daily.dev',
172
165
  };
173
166
 
174
167
  async function handler(ctx) {
@@ -178,12 +171,12 @@ async function handler(ctx) {
178
171
  const buildId = await getBuildId();
179
172
 
180
173
  const userData = await cache.tryGet(`daily:user:${userId}`, async () => {
181
- const resposne = await ofetch(`${baseUrl}/_next/data/${buildId}/en/${userId}.json`, {
174
+ const response = await ofetch(`${baseUrl}/_next/data/${buildId}/en/${userId}.json`, {
182
175
  query: {
183
176
  userId,
184
177
  },
185
178
  });
186
- return resposne.pageProps;
179
+ return response.pageProps;
187
180
  });
188
181
  const user = (userData as any).user;
189
182
 
@@ -198,17 +191,7 @@ async function handler(ctx) {
198
191
  loggedIn: false,
199
192
  },
200
193
  });
201
- return edges.map(({ node }) => ({
202
- title: node.title,
203
- description: render({
204
- image: node.image,
205
- content: node.contentHtml?.replaceAll('\n', '<br>') ?? node.summary,
206
- }),
207
- link: node.permalink,
208
- author: node.author?.name,
209
- category: node.tags,
210
- pubDate: parseDate(node.createdAt),
211
- }));
194
+ return getList(edges);
212
195
  },
213
196
  config.cache.routeExpire,
214
197
  false
@@ -2,10 +2,15 @@ import { parseDate } from '@/utils/parse-date';
2
2
  import ofetch from '@/utils/ofetch';
3
3
  import cache from '@/utils/cache';
4
4
  import { config } from '@/config';
5
+ import { art } from '@/utils/render';
6
+ import path from 'node:path';
7
+ import { getCurrentPath } from '@/utils/helpers';
8
+ const __dirname = getCurrentPath(import.meta.url);
5
9
 
6
- const baseUrl = 'https://app.daily.dev';
10
+ export const baseUrl = 'https://app.daily.dev';
11
+ const gqlUrl = `https://api.daily.dev/graphql`;
7
12
 
8
- const getBuildId = () =>
13
+ export const getBuildId = () =>
9
14
  cache.tryGet(
10
15
  'daily:buildId',
11
16
  async () => {
@@ -17,40 +22,30 @@ const getBuildId = () =>
17
22
  false
18
23
  );
19
24
 
20
- const getData = async (graphqlQuery) => {
21
- const response = await ofetch(`${baseUrl}/api/graphql`, {
25
+ export const getData = async (graphqlQuery) => {
26
+ const response = await ofetch(gqlUrl, {
22
27
  method: 'POST',
23
28
  body: graphqlQuery,
24
29
  });
25
30
  return response.data.page.edges;
26
31
  };
27
32
 
28
- const getList = (data) =>
29
- data.map((value) => {
30
- const { id, title, image, permalink, summary, createdAt, numUpvotes, author, tags, numComments } = value.node;
31
- const pubDate = parseDate(createdAt);
32
- return {
33
- id,
34
- title,
35
- link: permalink,
36
- description: summary,
37
- author: author?.name,
38
- itunes_item_image: image,
39
- pubDate,
40
- upvotes: numUpvotes,
41
- comments: numComments,
42
- category: tags,
43
- };
44
- });
45
-
46
- const getRedirectedLink = (data) =>
47
- Promise.all(
48
- data.map((v) =>
49
- cache.tryGet(v.link, async () => {
50
- const resp = await ofetch.raw(v.link);
51
- return { ...v, link: resp.headers.get('location') };
52
- })
53
- )
54
- );
33
+ const render = (data) => art(path.join(__dirname, 'templates/posts.art'), data);
55
34
 
56
- export { baseUrl, getBuildId, getData, getList, getRedirectedLink };
35
+ export const getList = (edges) =>
36
+ edges.map(({ node }) => ({
37
+ id: node.id,
38
+ title: node.title,
39
+ link: node.commentsPermalink ?? node.permalink,
40
+ guid: node.permalink,
41
+ description: render({
42
+ image: node.image,
43
+ content: node.contentHtml?.replaceAll('\n', '<br>') ?? node.summary,
44
+ }),
45
+ author: node.author?.name,
46
+ itunes_item_image: node.image,
47
+ pubDate: parseDate(node.createdAt),
48
+ upvotes: node.numUpvotes,
49
+ comments: node.numComments,
50
+ category: node.tags,
51
+ }));
@@ -1,7 +1,7 @@
1
1
  import { Route } from '@/types';
2
2
  import cache from '@/utils/cache';
3
- import got from '@/utils/got';
4
- import { load } from 'cheerio';
3
+ import ofetch from '@/utils/ofetch';
4
+
5
5
  import { parseDate } from '@/utils/parse-date';
6
6
 
7
7
  export const route: Route = {
@@ -10,49 +10,38 @@ export const route: Route = {
10
10
  path: '/news',
11
11
  radar: [
12
12
  {
13
- source: ['dataguidance.com/search/news'],
13
+ source: ['www.dataguidance.com/info'],
14
14
  },
15
15
  ],
16
16
  maintainers: ['harveyqiu'],
17
17
  handler,
18
- url: 'dataguidance.com/news',
18
+ url: 'https://www.dataguidance.com/info?article_type=news_post',
19
19
  };
20
20
 
21
21
  async function handler() {
22
22
  const rootUrl = 'https://www.dataguidance.com';
23
- const currentUrl = `${rootUrl}/search/news/`;
24
-
25
- const response = await got({
26
- method: 'get',
27
- url: currentUrl,
28
- });
29
-
30
- const $ = load(response.data);
23
+ const url = 'https://dgcb20-ca-northeurope-dglive.yellowground-c1f17366.northeurope.azurecontainerapps.io/api/v1/content/articles?order=DESC_publishedOn&limit=25&article_types=news_post';
31
24
 
32
- let items = $('.field-name-title')
33
- .toArray()
34
- .map((item) => {
35
- item = $(item);
36
- const a = item.find('a').first();
25
+ const response = await ofetch(url);
37
26
 
38
- return {
39
- title: a.text(),
40
- link: `${rootUrl}${a.attr('href')}`,
41
- };
42
- });
27
+ const data = response.data;
43
28
 
29
+ let items = data.map((item) => ({
30
+ title: item.title.en,
31
+ link: `${rootUrl}${item.url}`,
32
+ url: item.url,
33
+ pubDate: parseDate(item.publishedOn),
34
+ }));
35
+ const baseUrl = 'https://dgcb20-ca-northeurope-dglive.yellowground-c1f17366.northeurope.azurecontainerapps.io/api/v1/content/articles/by_path?path=';
44
36
  items = await Promise.all(
45
37
  items.map((item) =>
46
38
  cache.tryGet(item.link, async () => {
47
- const detailResponse = await got({
48
- method: 'get',
49
- url: item.link,
50
- });
39
+ const detailUrl = `${baseUrl}${item.url}`;
51
40
 
52
- const content = load(detailResponse.data);
53
- item.pubDate = parseDate(content('.field-name-post-date').text());
54
- item.description = content('.field-name-body').html();
41
+ const detailResponse = await ofetch(detailUrl);
55
42
 
43
+ item.description = detailResponse.contentBody?.html.en.replaceAll('\n', '<br>');
44
+ delete item.url;
56
45
  return item;
57
46
  })
58
47
  )
@@ -60,7 +49,7 @@ async function handler() {
60
49
 
61
50
  return {
62
51
  title: 'Data Guidance News',
63
- link: currentUrl,
52
+ link: 'https://www.dataguidance.com/info?article_type=news_post',
64
53
  item: items,
65
54
  };
66
55
  }
@@ -5,7 +5,7 @@ import { baseUrl, parseItem } from './utils';
5
5
 
6
6
  export const route: Route = {
7
7
  path: '/news/:type?',
8
- categories: ['new-media'],
8
+ categories: ['new-media', 'popular'],
9
9
  example: '/dcfever/news',
10
10
  parameters: { type: '分類,預設為所有新聞' },
11
11
  name: '新聞中心',
@@ -5,7 +5,7 @@ import { baseUrl, parseItem } from './utils';
5
5
 
6
6
  export const route: Route = {
7
7
  path: '/reviews/:type?',
8
- categories: ['new-media'],
8
+ categories: ['new-media', 'popular'],
9
9
  example: '/dcfever/reviews/cameras',
10
10
  parameters: { type: '分類,預設為 `cameras`' },
11
11
  radar: [
@@ -6,7 +6,7 @@ import { baseUrl, parseTradeItem } from './utils';
6
6
 
7
7
  export const route: Route = {
8
8
  path: '/trading/search/:keyword/:mainCat?',
9
- categories: ['new-media'],
9
+ categories: ['new-media', 'popular'],
10
10
  example: '/dcfever/trading/search/Sony',
11
11
  parameters: { keyword: '關鍵字', mainCat: '主要分類 ID,見上表' },
12
12
  name: '二手市集 - 物品搜尋',
@@ -6,7 +6,7 @@ import { baseUrl, parseTradeItem } from './utils';
6
6
 
7
7
  export const route: Route = {
8
8
  path: '/trading/:id',
9
- categories: ['new-media'],
9
+ categories: ['new-media', 'popular'],
10
10
  example: '/dcfever/trading/1',
11
11
  parameters: { id: '分類 ID,見下表' },
12
12
  name: '二手市集',