diff --git a/.github/workflows/dependabot-fork.yml b/.github/workflows/dependabot-fork.yml index f02408a97b3b43..9350ec5d66efd2 100644 --- a/.github/workflows/dependabot-fork.yml +++ b/.github/workflows/dependabot-fork.yml @@ -12,7 +12,7 @@ jobs: uses: actions/checkout@v3 - name: Comment Dependabot PR - uses: thollander/actions-comment-pull-request@v1 + uses: thollander/actions-comment-pull-request@v2 with: message: '@dependabot ignore this dependency' GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/docs/en/university.md b/docs/en/university.md index f90476705f60d1..156c1f8335d1d6 100644 --- a/docs/en/university.md +++ b/docs/en/university.md @@ -161,7 +161,7 @@ Note: [Source website](https://gs.bjtu.edu.cn/) only provides articles in Chines -## UMASS Amherst +## University of Massachusetts Amherst ### College of Electrical and Computer Engineering @@ -188,3 +188,21 @@ Note:[Source website](https://ece.umass.edu/seminar) may be empty when there's #### Featured Stories + +## University of Texas at Dallas + +### International Student Services + + + +## University of Washington + +### Global Innovation Exchange News + + + +| Blog | In The News | +| ---- | ----------- | +| blog | inthenews | + + diff --git a/docs/university.md b/docs/university.md index 3f22568936f920..512af06d600ccd 100644 --- a/docs/university.md +++ b/docs/university.md @@ -32,12 +32,24 @@ pageClass: routes -## UTDallas +## University of Texas at Dallas ### International Student Services +## University of Washington + +### Global Innovation Exchange News + + + +| Blog | In The News | +| ---- | ----------- | +| blog | inthenews | + + + ## 安徽工业大学 ### 教务处 diff --git a/lib/v2/gov/customs/list.js b/lib/v2/gov/customs/list.js index 288729c912aadb..ea51292edd9b33 100644 --- a/lib/v2/gov/customs/list.js +++ b/lib/v2/gov/customs/list.js @@ -24,7 +24,7 @@ module.exports = async (ctx) => { break; } - const browser = await require('@/utils/puppeteer')(); + const browser = await require('@/utils/puppeteer')({ stealth: true }); const list = await ctx.cache.tryGet( link, diff --git a/lib/v2/gov/maintainer.js b/lib/v2/gov/maintainer.js index 911d75f6db9361..88d9f483fb6c2f 100644 --- a/lib/v2/gov/maintainer.js +++ b/lib/v2/gov/maintainer.js @@ -12,7 +12,7 @@ module.exports = { '/cmse/kpjy/:id': ['nczitzk'], '/cmse/:path+': ['nczitzk'], '/cnnic/:path+': ['nczitzk'], - '/customs/list/:gchannel?': ['Jeason0228', 'TonyRL'], + '/customs/list/:gchannel?': ['Jeason0228', 'TonyRL', 'he1q'], '/fmprc/:category?': ['nicolaszf', 'nczitzk'], '/immiau/news': ['liu233w'], '/mee/ywdt?': ['liuxsdev'], diff --git a/lib/v2/uw/gix/news.js b/lib/v2/uw/gix/news.js new file mode 100644 index 00000000000000..8bec563bfa94e3 --- /dev/null +++ b/lib/v2/uw/gix/news.js @@ -0,0 +1,67 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +const gixBaseURL = 'https://gixnetwork.org'; + +module.exports = async (ctx) => { + const category = ctx.params.category; + + let newsURL = gixBaseURL + '/news'; + let feedTitle = 'UW GIX News - '; + let listSelector = 'body > div.site > div.site-content > div.content-area > main.site-main > '; + + switch (category) { + case 'blog': + newsURL += '/blog/'; + feedTitle += 'Blogs'; + listSelector += 'div.blog-wrapper > section.blog-list > article'; + break; + case 'inthenews': + newsURL += '/inthenews/'; + feedTitle += 'In The News'; + listSelector += 'div.news-wrapper > section.news-list > article'; + break; + } + + const response = await got(newsURL); + + const data = response.data; + + const $ = cheerio.load(data); + + const list = $(listSelector) + .map((index, item) => { + item = $(item); + const content = item.find('header').find('h2').find('a'); + const time = item.find('header').find('span.h4').text(); + + return { + // title: content.text(), + time, + link: content.attr('href'), + }; + }) + .get(); + + const itemContent = await Promise.all( + list.map((item) => + ctx.cache.tryGet(item.link, async () => { + const descriptionResponse = await got(item.link); + + const content = cheerio.load(descriptionResponse.data); + + item.title = content('header.entry-header').find('h1').text(); + item.description = content('div.entry-content').html(); + item.pubDate = Date.parse(item.time); + + return item; + }) + ) + ); + + ctx.state.data = { + title: feedTitle, + link: newsURL, + item: itemContent, + }; +}; diff --git a/lib/v2/uw/maintainer.js b/lib/v2/uw/maintainer.js new file mode 100644 index 00000000000000..5b877a13e47340 --- /dev/null +++ b/lib/v2/uw/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/gix/news/:category': ['dykderrick'], +}; diff --git a/lib/v2/uw/radar.js b/lib/v2/uw/radar.js new file mode 100644 index 00000000000000..75428ea4136eb6 --- /dev/null +++ b/lib/v2/uw/radar.js @@ -0,0 +1,13 @@ +module.exports = { + 'gixnetwork.org': { + _name: 'University of Washington', + '.': [ + { + title: 'Global Innovation Exchange News', + docs: 'https://docs.rsshub.app/university.html#university-of-washington', + source: ['/news/:category'], + target: '/uw/gix/news/:category', + }, + ], + }, +}; diff --git a/lib/v2/uw/router.js b/lib/v2/uw/router.js new file mode 100644 index 00000000000000..3f37e02d665ed5 --- /dev/null +++ b/lib/v2/uw/router.js @@ -0,0 +1,3 @@ +module.exports = function (router) { + router.get('/gix/news/:category', require('./gix/news')); +}; diff --git a/package.json b/package.json index 40a95306f7587d..bf4a0ab5d4e5c1 100644 --- a/package.json +++ b/package.json @@ -135,7 +135,7 @@ "puppeteer-extra": "3.3.4", "puppeteer-extra-plugin-stealth": "2.11.1", "query-string": "7.1.3", - "rand-user-agent": "1.0.92", + "rand-user-agent": "1.0.93", "re2": "1.17.8", "require-all": "3.0.0", "rss-parser": "3.12.0", diff --git a/yarn.lock b/yarn.lock index 61cdecc9ea4849..fccc31e84e4b6e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11584,10 +11584,10 @@ ramda@^0.26.1: resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.26.1.tgz#8d41351eb8111c55353617fc3bbffad8e4d35d06" integrity sha512-hLWjpy7EnsDBb0p+Z3B7rPi3GDeRG5ZtiI33kJhTt+ORCd38AbAIjB/9zRIUoeTbE/AVX5ZkU7m6bznsvrf8eQ== -rand-user-agent@1.0.92: - version "1.0.92" - resolved "https://registry.yarnpkg.com/rand-user-agent/-/rand-user-agent-1.0.92.tgz#1ed7d6b6f05dc3b83f90761ff9aaf42af7ff7da2" - integrity sha512-kX6bxvq29Jb59XslWgpmHGJ+S6TCULgpR9MVcYPb0eO05j8XV/M/3HmSdimfHEcFvczJA/ILLkHDoxRtyc8Ivw== +rand-user-agent@1.0.93: + version "1.0.93" + resolved "https://registry.yarnpkg.com/rand-user-agent/-/rand-user-agent-1.0.93.tgz#1b1aa5035c66892328878bf63e9b0916a73a0e0d" + integrity sha512-S9+nr4yaTUtzhLi4VBiPXydFI/e95S7NcJPG4D80arZPu0Q90EjTjJZNbCW5QGLKdc6Ze9A0S7MBK5gs97LBug== randexp@0.4.6: version "0.4.6"