diff --git a/lib/v2/google/citations.js b/lib/v2/google/citations.js index f1a828c16..d6210ff84 100644 --- a/lib/v2/google/citations.js +++ b/lib/v2/google/citations.js @@ -3,7 +3,6 @@ const cheerio = require('cheerio'); module.exports = async (ctx) => { const id = ctx.params.id; - let description = `Google Scholar Citation Monitor: ${id};`; const BASE_URL = `https://scholar.google.com`; const url = `https://scholar.google.com/citations?user=${id}`; @@ -17,27 +16,27 @@ module.exports = async (ctx) => { const profile = $('#gsc_prf .gsc_prf_il').eq(0).text(); const homePage = $('#gsc_prf_ivh a').attr('href'); const name = $('#gsc_prf_in').text(); - description += `name: ${name}; profile: ${profile}; homePage: ${homePage}`; + const description = `Google Scholar Citation Monitor: ${name}; Profile: ${profile}; HomePage: ${homePage}`; const list = $('#gsc_a_b .gsc_a_tr').get(); const out = list.map((item) => { const $ = cheerio.load(item); - let itemUrl = $('.gsc_a_t a').attr('data-href'); - itemUrl = BASE_URL + itemUrl; + const itemUrl = BASE_URL + $('.gsc_a_t a').attr('href'); const author = $('.gsc_a_t div').eq(0).text(); const publication = $('.gsc_a_t div').eq(1).text(); return { title: $('.gsc_a_t a').text(), + author, description: `Author: ${author}; Publication: ${publication}`, link: itemUrl, guid: itemUrl, }; }); ctx.state.data = { - title: `Google Scholar Citation Monitor: ${id}`, + title: `Google Scholar: ${name}`, link: url, description, item: out, diff --git a/lib/v2/google/maintainer.js b/lib/v2/google/maintainer.js index 6abbdd362..19efb7ccb 100644 --- a/lib/v2/google/maintainer.js +++ b/lib/v2/google/maintainer.js @@ -1,7 +1,7 @@ module.exports = { '/album/:id': ['hoilc'], '/alerts/:keyword': ['TonyRL'], - '/citations/:id': ['KellyHwong'], + '/citations/:id': ['KellyHwong', 'const7'], '/doodles/:language?': ['xyqfer'], '/fonts/:sort?': ['Fatpandac'], '/news/:category/:locale': ['zoenglinghou'], diff --git a/website/docs/routes/journal.mdx b/website/docs/routes/journal.mdx index 4005e3648..72d4d1089 100644 --- a/website/docs/routes/journal.mdx +++ b/website/docs/routes/journal.mdx @@ -165,8 +165,10 @@ ### Author Citations {#google-scholar-author-citations} - - The parameter id in the route is the id in the URL of the user's Google Scholar reference page, for example `https://scholar.google.com/citations?hl=zh-CN&user=mlmE4JMAAAAJ` to `mlmE4JMAAAAJ` + + The parameter id in the route is the id in the URL of the user's Google Scholar reference page, for example `https://scholar.google.com/citations?user=mlmE4JMAAAAJ` to `mlmE4JMAAAAJ`. + + Query parameters are also supported here, for example `https://scholar.google.com/citations?user=mlmE4JMAAAAJ&sortby=pubdate` to `mlmE4JMAAAAJ&sortby=pubdate`. Please make sure that the user id (`mlmE4JMAAAAJ` in this case) should be the first parameter in the query string. ## IEEE Computer Society {#ieee-computer-society}