@@ -75,13 +75,13 @@ const getGithubTrendingFromServerless = async (id, groupName, siteName, topicNam
7575 }
7676}
7777
78- // 掘金热门
78+ // 掘金热门 https://juejin.cn/frontend
7979const getJueJinHot = async ( id , groupName , siteName , topicName , topicUrl , webHook , app ) => {
8080 try {
8181 const pageSize = app . config . articleSubscription . pageSize
8282 const params = {
8383 id_type : 2 ,
84- sort_type : 3 ,
84+ sort_type : 200 ,
8585 cate_id : topicUrl ,
8686 cursor : "0" ,
8787 limit : pageSize
@@ -99,6 +99,47 @@ const getJueJinHot = async (id, groupName, siteName, topicName, topicUrl, webHoo
9999 }
100100}
101101
102+ // https://dev.to/t/architecture/top/week
103+ const getDevArchitectureHot = async ( id , groupName , siteName , topicName , topicUrl , webHook , app ) => {
104+ try {
105+ const pageSize = app . config . articleSubscription . pageSize
106+ const res = await axios . get ( `https://dev.to/search/feed_content?per_page=5&page=0&tag=architecture&sort_by=public_reactions_count&sort_direction=desc&tag_names%5B%5D=architecture&approved=&class_name=Article&published_at%5Bgte%5D=2024-11-10T02%3A43%3A45Z` , { timeout } )
107+ let msg = `## DEV Architecture 每周 Top5\n\n`
108+
109+ const data = res ?. data ?. result || [ ]
110+ for ( let i = 0 ; i < pageSize ; i ++ ) {
111+ msg += `${ i + 1 } 、[${ data [ i ] . title } ](https://dev.to${ data [ i ] . path } )\n\n`
112+ }
113+ msg += `[点击查看更多内容](https://dev.to/t/architecture/top/week)`
114+ sendArticleMsg ( 'DEV Architecture 每周 Top5' , msg , webHook )
115+ logFunc ( app , id , groupName , siteName , topicName , '成功' )
116+ } catch ( err ) {
117+ logFunc ( app , id , groupName , siteName , topicName , `失败` , `${ JSON . stringify ( err ) } ` )
118+ }
119+ }
120+
121+ // https://react.statuscode.com/latest
122+ const getReactStatusHot = async ( id , groupName , siteName , topicName , topicUrl , webHook , app ) => {
123+ try {
124+ const pageSize = app . config . articleSubscription . pageSize
125+ const { data } = await axios . get ( `https://react.statuscode.com/latest` , { timeout } )
126+ let msg = `## React Status\n\n`
127+
128+ const $ = cheerio . load ( data )
129+ const items = $ ( 'table.el-item' ) . find ( 'span.mainlink' )
130+ for ( let i = 0 ; i < pageSize ; i ++ ) {
131+ const name = items . eq ( i ) . text ( )
132+ const url = items . eq ( i ) . find ( 'a' ) . attr ( 'href' )
133+ msg += `${ i + 1 } 、[${ name } ](${ url } )\n\n`
134+ }
135+ msg += `[点击查看更多内容](https://react.statuscode.com/latest)`
136+ sendArticleMsg ( 'React Status' , msg , webHook )
137+ logFunc ( app , id , groupName , siteName , topicName , '成功' )
138+ } catch ( err ) {
139+ logFunc ( app , id , groupName , siteName , topicName , `失败` , `Github 网络不佳 ${ JSON . stringify ( err ) } ` )
140+ }
141+ }
142+
102143// 自定义消息
103144const customMessage = async ( id , groupName , siteName , messageTitle , message , isAtAll , webHook , app ) => {
104145 try {
@@ -129,5 +170,7 @@ module.exports = {
129170 getGithubTrendingFromJueJin,
130171 getGithubTrendingFromServerless,
131172 getJueJinHot,
173+ getDevArchitectureHot,
174+ getReactStatusHot,
132175 customMessage
133176}
0 commit comments