From 8d704aa85097a05d607a7a6458744e8f6fa9f38a Mon Sep 17 00:00:00 2001 From: Muyun99 <27944418+Muyun99@users.noreply.github.com> Date: Tue, 15 Oct 2024 00:52:06 +0800 Subject: [PATCH 01/11] [update] update cool paper --- lib/routes/papers/index.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/routes/papers/index.ts b/lib/routes/papers/index.ts index 47cb03656e425e..ead2927feb3098 100644 --- a/lib/routes/papers/index.ts +++ b/lib/routes/papers/index.ts @@ -20,7 +20,7 @@ export const handler = async (ctx) => { const feedUrl = new URL(`${category}/feed`, rootUrl).href; const site = category.split(/\//)[0]; - const apiKimiUrl = new URL(`${site}/kimi/`, rootUrl).href; + const apiKimiUrl = new URL(`${site}/kimi?paper=`, rootUrl).href; const feed = await parser.parseURL(feedUrl); @@ -91,6 +91,7 @@ export const route: Route = { | arXiv Computation and Language (cs.CL) | arxiv/cs.CL | | arXiv Computer Vision and Pattern Recognition (cs.CV) | arxiv/cs.CV | | arXiv Machine Learning (cs.LG) | arxiv/cs.LG | + | arXiv Robotics (cs.RO) | arxiv/cs.RO | `, categories: ['journal'], @@ -124,5 +125,10 @@ export const route: Route = { source: ['papers.cool/arxiv/cs.LG'], target: '/arxiv/cs.LG', }, + { + title: 'arXiv Robotics (cs.RO)', + source: ['papers.cool/arxiv/cs.RO'], + target: '/arxiv/cs.RO', + }, ], }; From 174dbb71792562d1444d34c7129d5e9d86fd7be2 Mon Sep 17 00:00:00 2001 From: Muyun99 <27944418+Muyun99@users.noreply.github.com> Date: Wed, 11 Dec 2024 01:42:39 +0800 Subject: [PATCH 02/11] [add] add author of cool paper --- lib/routes/papers/index.ts | 8 +++++--- lib/routes/papers/templates/description.art | 4 ++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/routes/papers/index.ts b/lib/routes/papers/index.ts index ead2927feb3098..3f0f0b0f8201ec 100644 --- a/lib/routes/papers/index.ts +++ b/lib/routes/papers/index.ts @@ -34,10 +34,12 @@ export const handler = async (ctx) => { const kimiUrl = new URL(id, apiKimiUrl).href; const pdfUrl = Object.hasOwn(pdfUrlGenerators, site) ? pdfUrlGenerators[site](id) : undefined; + const authorString = item.author; const description = art(path.join(__dirname, 'templates/description.art'), { pdfUrl, siteUrl: item.link, kimiUrl, + authorString, summary: item.summary, }); @@ -47,7 +49,7 @@ export const handler = async (ctx) => { pubDate: parseDate(item.pubDate ?? ''), link: item.link, category: item.categories, - author: item.creator, + author: authorString, doi: `${site}${id}`, guid, id: guid, @@ -77,7 +79,7 @@ export const route: Route = { path: '/:category{.+}?', name: 'Topic', url: 'papers.cool', - maintainers: ['nczitzk'], + maintainers: ['nczitzk', 'Muyun99'], handler, example: '/papers/arxiv/cs.AI', parameters: { category: 'Category, arXiv Artificial Intelligence (cs.AI) by default' }, @@ -91,7 +93,7 @@ export const route: Route = { | arXiv Computation and Language (cs.CL) | arxiv/cs.CL | | arXiv Computer Vision and Pattern Recognition (cs.CV) | arxiv/cs.CV | | arXiv Machine Learning (cs.LG) | arxiv/cs.LG | - | arXiv Robotics (cs.RO) | arxiv/cs.RO | + | arXiv Robotics (cs.RO) | arxiv/cs.RO | `, categories: ['journal'], diff --git a/lib/routes/papers/templates/description.art b/lib/routes/papers/templates/description.art index 368ea61f8ee842..0c11cd60997369 100644 --- a/lib/routes/papers/templates/description.art +++ b/lib/routes/papers/templates/description.art @@ -10,6 +10,10 @@ [Kimi] {{ /if }} +{{ if authorString }} +

Authors: {{ authorString }}

+{{ /if }} + {{ if summary }}

{{ summary }}

{{ /if }} \ No newline at end of file From 7345ca97248677c01d28b3af6b9dc3575bdae1f5 Mon Sep 17 00:00:00 2001 From: Muyun99 <27944418+Muyun99@users.noreply.github.com> Date: Sat, 14 Dec 2024 23:19:23 +0800 Subject: [PATCH 03/11] [add] add rss of cool paper query topic --- lib/routes/papers/index.ts | 53 ++++++++++++++++++++++++++++---------- 1 file changed, 40 insertions(+), 13 deletions(-) diff --git a/lib/routes/papers/index.ts b/lib/routes/papers/index.ts index 3f0f0b0f8201ec..e63a75391a2ffd 100644 --- a/lib/routes/papers/index.ts +++ b/lib/routes/papers/index.ts @@ -12,12 +12,23 @@ const pdfUrlGenerators = { }; export const handler = async (ctx) => { - const { category = 'arxiv/cs.AI' } = ctx.req.param(); + const { category } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 150; const rootUrl = 'https://papers.cool'; - const currentUrl = new URL(category, rootUrl).href; - const feedUrl = new URL(`${category}/feed`, rootUrl).href; + let currentUrl; + let feedUrl; + + if (category.startsWith('arxiv/')) { + currentUrl = new URL(category, rootUrl).href; + feedUrl = new URL(`${category}/feed`, rootUrl).href; + } else if (category.startsWith('query')) { + const query = category.split(/\//)[1]; + currentUrl = new URL(`arxiv/search?highlight=1&query=${query}&sort=0`, rootUrl).href; + feedUrl = new URL(`arxiv/search/feed?query=${query}`, rootUrl).href; + } else { + ctx.throw(400, 'Invalid category'); + } const site = category.split(/\//)[0]; const apiKimiUrl = new URL(`${site}/kimi?paper=`, rootUrl).href; @@ -81,19 +92,25 @@ export const route: Route = { url: 'papers.cool', maintainers: ['nczitzk', 'Muyun99'], handler, - example: '/papers/arxiv/cs.AI', - parameters: { category: 'Category, arXiv Artificial Intelligence (cs.AI) by default' }, + example: '/papers/arxiv/cs.AI or /papers/query/Detection', + parameters: { + category: 'Category, arXiv Artificial Intelligence (cs.AI) by default', + keyword: 'Keyword to search for papers, e.g., Detection, Segmentation, etc.', + }, description: `:::tip - If you subscribe to [arXiv Artificial Intelligence (cs.AI)](https://papers.cool/arxiv/cs.AI),where the URL is \`https://papers.cool/arxiv/cs.AI\`, extract the part \`https://papers.cool/\` to the end, and use it as the parameter to fill in. Therefore, the route will be [\`/papers/arxiv/cs.AI\`](https://rsshub.app/papers/arxiv/cs.AI). + If you subscribe to [arXiv Artificial Intelligence (cs.AI)](https://papers.cool/arxiv/cs.AI), where the URL is \`https://papers.cool/arxiv/cs.AI\`, extract the part \`https://papers.cool/\` to the end, and use it as the parameter to fill in. Therefore, the route will be [\`/papers/arxiv/cs.AI\`](https://rsshub.app/papers/arxiv/cs.AI). + If you subscibe to [arXiv Paper queryed by Detection](https://papers.cool/arxiv/search?highlight=1&query=Detection), where the URL is \`https://papers.cool/arxiv/search?highlight=1&query=Detection\`, extract the part \`https://papers.cool/\` to the end, and use it as the parameter to fill in. Therefore, the route will be [\`/papers/query/Detection\`](https://rsshub.app/papers/query/Detection). ::: - | Category | id | - | ----------------------------------------------------- | ----------- | - | arXiv Artificial Intelligence (cs.AI) | arxiv/cs.AI | - | arXiv Computation and Language (cs.CL) | arxiv/cs.CL | - | arXiv Computer Vision and Pattern Recognition (cs.CV) | arxiv/cs.CV | - | arXiv Machine Learning (cs.LG) | arxiv/cs.LG | - | arXiv Robotics (cs.RO) | arxiv/cs.RO | + | Category | id | + | ----------------------------------------------------- | ------------------- | + | arXiv Artificial Intelligence (cs.AI) | arxiv/cs.AI | + | arXiv Computation and Language (cs.CL) | arxiv/cs.CL | + | arXiv Computer Vision and Pattern Recognition (cs.CV) | arxiv/cs.CV | + | arXiv Machine Learning (cs.LG) | arxiv/cs.LG | + | arXiv Robotics (cs.RO) | arxiv/cs.RO | + | arXiv Paper queryed by Detection | query/Detection | + | arXiv Paper queryed by Segmentation | query/Segmentation | `, categories: ['journal'], @@ -132,5 +149,15 @@ export const route: Route = { source: ['papers.cool/arxiv/cs.RO'], target: '/arxiv/cs.RO', }, + { + title: 'arXiv Paper queryed by Detection', + source: ['papers.cool/arxiv/search?highlight=1&query=Detection&sort=0`'], + target: '/papers/query/Detection', + }, + { + title: 'arXiv Paper queryed by Segmentation', + source: ['papers.cool/arxiv/search?highlight=1&query=Segmentation&sort=0`'], + target: '/papers/query/Segmentation', + }, ], }; From ccd782b51ee0ca237fe23bddee2191793d23c71f Mon Sep 17 00:00:00 2001 From: Muyun99 <27944418+Muyun99@users.noreply.github.com> Date: Tue, 17 Dec 2024 22:17:57 +0800 Subject: [PATCH 04/11] [update] update --- lib/routes/papers/index.ts | 39 ++---------- lib/routes/papers/query.ts | 119 +++++++++++++++++++++++++++++++++++++ 2 files changed, 125 insertions(+), 33 deletions(-) create mode 100644 lib/routes/papers/query.ts diff --git a/lib/routes/papers/index.ts b/lib/routes/papers/index.ts index e63a75391a2ffd..689b482233102f 100644 --- a/lib/routes/papers/index.ts +++ b/lib/routes/papers/index.ts @@ -12,23 +12,12 @@ const pdfUrlGenerators = { }; export const handler = async (ctx) => { - const { category } = ctx.req.param(); + const { category = 'arxiv/cs.AI' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 150; const rootUrl = 'https://papers.cool'; - let currentUrl; - let feedUrl; - - if (category.startsWith('arxiv/')) { - currentUrl = new URL(category, rootUrl).href; - feedUrl = new URL(`${category}/feed`, rootUrl).href; - } else if (category.startsWith('query')) { - const query = category.split(/\//)[1]; - currentUrl = new URL(`arxiv/search?highlight=1&query=${query}&sort=0`, rootUrl).href; - feedUrl = new URL(`arxiv/search/feed?query=${query}`, rootUrl).href; - } else { - ctx.throw(400, 'Invalid category'); - } + const currentUrl = new URL(category, rootUrl).href; + const feedUrl = new URL(`arxiv/${category}/feed`, rootUrl).href; const site = category.split(/\//)[0]; const apiKimiUrl = new URL(`${site}/kimi?paper=`, rootUrl).href; @@ -87,19 +76,15 @@ export const handler = async (ctx) => { }; export const route: Route = { - path: '/:category{.+}?', + path: '/arxiv/:category{.+}?', name: 'Topic', url: 'papers.cool', maintainers: ['nczitzk', 'Muyun99'], handler, - example: '/papers/arxiv/cs.AI or /papers/query/Detection', - parameters: { - category: 'Category, arXiv Artificial Intelligence (cs.AI) by default', - keyword: 'Keyword to search for papers, e.g., Detection, Segmentation, etc.', - }, + example: 'https://rsshub.app/papers/arxiv/cs.AI or /papers/query/Detection', + parameters: { category: 'Category, arXiv Artificial Intelligence (cs.AI) by default' }, description: `:::tip If you subscribe to [arXiv Artificial Intelligence (cs.AI)](https://papers.cool/arxiv/cs.AI), where the URL is \`https://papers.cool/arxiv/cs.AI\`, extract the part \`https://papers.cool/\` to the end, and use it as the parameter to fill in. Therefore, the route will be [\`/papers/arxiv/cs.AI\`](https://rsshub.app/papers/arxiv/cs.AI). - If you subscibe to [arXiv Paper queryed by Detection](https://papers.cool/arxiv/search?highlight=1&query=Detection), where the URL is \`https://papers.cool/arxiv/search?highlight=1&query=Detection\`, extract the part \`https://papers.cool/\` to the end, and use it as the parameter to fill in. Therefore, the route will be [\`/papers/query/Detection\`](https://rsshub.app/papers/query/Detection). ::: | Category | id | @@ -109,8 +94,6 @@ export const route: Route = { | arXiv Computer Vision and Pattern Recognition (cs.CV) | arxiv/cs.CV | | arXiv Machine Learning (cs.LG) | arxiv/cs.LG | | arXiv Robotics (cs.RO) | arxiv/cs.RO | - | arXiv Paper queryed by Detection | query/Detection | - | arXiv Paper queryed by Segmentation | query/Segmentation | `, categories: ['journal'], @@ -149,15 +132,5 @@ export const route: Route = { source: ['papers.cool/arxiv/cs.RO'], target: '/arxiv/cs.RO', }, - { - title: 'arXiv Paper queryed by Detection', - source: ['papers.cool/arxiv/search?highlight=1&query=Detection&sort=0`'], - target: '/papers/query/Detection', - }, - { - title: 'arXiv Paper queryed by Segmentation', - source: ['papers.cool/arxiv/search?highlight=1&query=Segmentation&sort=0`'], - target: '/papers/query/Segmentation', - }, ], }; diff --git a/lib/routes/papers/query.ts b/lib/routes/papers/query.ts new file mode 100644 index 00000000000000..5602e981c64d25 --- /dev/null +++ b/lib/routes/papers/query.ts @@ -0,0 +1,119 @@ +import { Route } from '@/types'; +import { getCurrentPath } from '@/utils/helpers'; +const __dirname = getCurrentPath(import.meta.url); + +import { parseDate } from '@/utils/parse-date'; +import { art } from '@/utils/render'; +import path from 'node:path'; +import parser from '@/utils/rss-parser'; + +const pdfUrlGenerators = { + arxiv: (id: string) => `https://arxiv.org/pdf/${id}.pdf`, +}; + +export const handler = async (ctx) => { + const { keyword } = ctx.req.param(); + const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 150; + + const rootUrl = 'https://papers.cool'; + const query = keyword.split(/\//)[1]; + const currentUrl = new URL(`arxiv/search?highlight=1&query=${query}&sort=0`, rootUrl).href; + const feedUrl = new URL(`arxiv/search/feed?query=${query}`, rootUrl).href; + + const site = keyword.split(/\//)[0]; + const apiKimiUrl = new URL(`${site}/kimi?paper=`, rootUrl).href; + + const feed = await parser.parseURL(feedUrl); + + const language = 'en'; + + const items = feed.items.slice(0, limit).map((item) => { + const title = item.title; + const guid = item.guid; + + const id = item.link?.split(/\//).pop() ?? ''; + const kimiUrl = new URL(id, apiKimiUrl).href; + const pdfUrl = Object.hasOwn(pdfUrlGenerators, site) ? pdfUrlGenerators[site](id) : undefined; + + const authorString = item.author; + const description = art(path.join(__dirname, 'templates/description.art'), { + pdfUrl, + siteUrl: item.link, + kimiUrl, + authorString, + summary: item.summary, + }); + + return { + title, + description, + pubDate: parseDate(item.pubDate ?? ''), + link: item.link, + category: item.categories, + author: authorString, + doi: `${site}${id}`, + guid, + id: guid, + content: { + html: description, + text: item.content, + }, + language, + enclosure_url: pdfUrl, + enclosure_type: 'application/pdf', + enclosure_title: title, + }; + }); + + return { + title: feed.title, + description: feed.description, + link: currentUrl, + item: items, + allowEmpty: true, + image: feed.image?.url, + language: feed.language, + }; +}; + +export const route: Route = { + path: '/query/:keyword{.+}?', + name: 'Topic', + url: 'papers.cool', + maintainers: ['Muyun99'], + handler, + example: '/papers/query/Detection', + parameters: { keyword: 'Keyword to search for papers, e.g., Detection, Segmentation, etc.' }, + description: `:::tip + If you subscibe to [arXiv Paper queryed by Detection](https://papers.cool/arxiv/search?highlight=1&query=Detection), where the URL is \`https://papers.cool/arxiv/search?highlight=1&query=Detection\`, extract the part \`https://papers.cool/\` to the end, and use it as the parameter to fill in. Therefore, the route will be [\`/papers/query/Detection\`](https://rsshub.app/papers/query/Detection). + ::: + + | Category | id | + | ----------------------------------------------------- | ------------------- | + | arXiv Paper queryed by Detection | query/Detection | + | arXiv Paper queryed by Segmentation | query/Segmentation | + `, + categories: ['journal'], + + features: { + requireConfig: false, + requirePuppeteer: false, + antiCrawler: false, + supportRadar: true, + supportBT: false, + supportPodcast: false, + supportScihub: true, + }, + radar: [ + { + title: 'arXiv Paper queryed by Detection', + source: ['papers.cool/arxiv/search?highlight=1&query=Detection&sort=0`'], + target: '/papers/query/Detection', + }, + { + title: 'arXiv Paper queryed by Segmentation', + source: ['papers.cool/arxiv/search?highlight=1&query=Segmentation&sort=0`'], + target: '/papers/query/Segmentation', + }, + ], +}; From 286eb337d5e8c09d3a9520f21bd6920e66b8ce63 Mon Sep 17 00:00:00 2001 From: Muyun99 <27944418+Muyun99@users.noreply.github.com> Date: Tue, 17 Dec 2024 22:24:00 +0800 Subject: [PATCH 05/11] [update] update --- lib/routes/papers/query.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/routes/papers/query.ts b/lib/routes/papers/query.ts index 5602e981c64d25..61b11e5062b2f5 100644 --- a/lib/routes/papers/query.ts +++ b/lib/routes/papers/query.ts @@ -12,7 +12,7 @@ const pdfUrlGenerators = { }; export const handler = async (ctx) => { - const { keyword } = ctx.req.param(); + const { keyword = 'query/Detection' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 150; const rootUrl = 'https://papers.cool'; From 704d90018093d906f1d7c2cc2b42fee7691a2dea Mon Sep 17 00:00:00 2001 From: Muyun99 <27944418+Muyun99@users.noreply.github.com> Date: Tue, 17 Dec 2024 22:29:04 +0800 Subject: [PATCH 06/11] [update] update --- lib/routes/papers/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/routes/papers/index.ts b/lib/routes/papers/index.ts index 689b482233102f..d99c58352823b3 100644 --- a/lib/routes/papers/index.ts +++ b/lib/routes/papers/index.ts @@ -81,7 +81,7 @@ export const route: Route = { url: 'papers.cool', maintainers: ['nczitzk', 'Muyun99'], handler, - example: 'https://rsshub.app/papers/arxiv/cs.AI or /papers/query/Detection', + example: '/papers/arxiv/cs.AI', parameters: { category: 'Category, arXiv Artificial Intelligence (cs.AI) by default' }, description: `:::tip If you subscribe to [arXiv Artificial Intelligence (cs.AI)](https://papers.cool/arxiv/cs.AI), where the URL is \`https://papers.cool/arxiv/cs.AI\`, extract the part \`https://papers.cool/\` to the end, and use it as the parameter to fill in. Therefore, the route will be [\`/papers/arxiv/cs.AI\`](https://rsshub.app/papers/arxiv/cs.AI). From 51dc8f1ef75d5fa6d54d181a2decbeb0c6028b84 Mon Sep 17 00:00:00 2001 From: Muyun99 <27944418+Muyun99@users.noreply.github.com> Date: Tue, 17 Dec 2024 22:30:37 +0800 Subject: [PATCH 07/11] [update] update --- lib/routes/papers/index.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/routes/papers/index.ts b/lib/routes/papers/index.ts index d99c58352823b3..41413d70b20f6a 100644 --- a/lib/routes/papers/index.ts +++ b/lib/routes/papers/index.ts @@ -87,13 +87,13 @@ export const route: Route = { If you subscribe to [arXiv Artificial Intelligence (cs.AI)](https://papers.cool/arxiv/cs.AI), where the URL is \`https://papers.cool/arxiv/cs.AI\`, extract the part \`https://papers.cool/\` to the end, and use it as the parameter to fill in. Therefore, the route will be [\`/papers/arxiv/cs.AI\`](https://rsshub.app/papers/arxiv/cs.AI). ::: - | Category | id | - | ----------------------------------------------------- | ------------------- | - | arXiv Artificial Intelligence (cs.AI) | arxiv/cs.AI | - | arXiv Computation and Language (cs.CL) | arxiv/cs.CL | - | arXiv Computer Vision and Pattern Recognition (cs.CV) | arxiv/cs.CV | - | arXiv Machine Learning (cs.LG) | arxiv/cs.LG | - | arXiv Robotics (cs.RO) | arxiv/cs.RO | + | Category | id | + | ----------------------------------------------------- | ----------- | + | arXiv Artificial Intelligence (cs.AI) | arxiv/cs.AI | + | arXiv Computation and Language (cs.CL) | arxiv/cs.CL | + | arXiv Computer Vision and Pattern Recognition (cs.CV) | arxiv/cs.CV | + | arXiv Machine Learning (cs.LG) | arxiv/cs.LG | + | arXiv Robotics (cs.RO) | arxiv/cs.RO | `, categories: ['journal'], From 2113e464bb9d76ba18a65c41bce687dbbdd8ffe3 Mon Sep 17 00:00:00 2001 From: Muyun99 <27944418+Muyun99@users.noreply.github.com> Date: Wed, 18 Dec 2024 23:23:48 +0800 Subject: [PATCH 08/11] [update] update --- lib/routes/papers/query.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/routes/papers/query.ts b/lib/routes/papers/query.ts index 61b11e5062b2f5..c9f6a59e1c9b82 100644 --- a/lib/routes/papers/query.ts +++ b/lib/routes/papers/query.ts @@ -22,7 +22,6 @@ export const handler = async (ctx) => { const site = keyword.split(/\//)[0]; const apiKimiUrl = new URL(`${site}/kimi?paper=`, rootUrl).href; - const feed = await parser.parseURL(feedUrl); const language = 'en'; From 04bf13f7ce6dfc0fc5d2118c59bac9eb8b77a2df Mon Sep 17 00:00:00 2001 From: Muyun99 <27944418+Muyun99@users.noreply.github.com> Date: Thu, 19 Dec 2024 00:13:09 +0800 Subject: [PATCH 09/11] trigger GitHub actions From 7fa999ed107afd662eed2b8993d8d8e004b442b0 Mon Sep 17 00:00:00 2001 From: Muyun99 <27944418+Muyun99@users.noreply.github.com> Date: Mon, 23 Dec 2024 22:56:42 +0800 Subject: [PATCH 10/11] [update] update --- lib/routes/papers/query.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/routes/papers/query.ts b/lib/routes/papers/query.ts index c9f6a59e1c9b82..b3555e9f035226 100644 --- a/lib/routes/papers/query.ts +++ b/lib/routes/papers/query.ts @@ -105,14 +105,9 @@ export const route: Route = { }, radar: [ { - title: 'arXiv Paper queryed by Detection', - source: ['papers.cool/arxiv/search?highlight=1&query=Detection&sort=0`'], - target: '/papers/query/Detection', - }, - { - title: 'arXiv Paper queryed by Segmentation', - source: ['papers.cool/arxiv/search?highlight=1&query=Segmentation&sort=0`'], - target: '/papers/query/Segmentation', + title: 'arXiv Paper queryed by Keyword', + source: ['papers.cool/arxiv/search?highlight=1&query=*&sort=0'], + target: '/papers/query/:keyword', }, ], }; From 018a51ec8272fc9484a8c14738467264c4aec6bd Mon Sep 17 00:00:00 2001 From: Muyun99 <27944418+Muyun99@users.noreply.github.com> Date: Thu, 26 Dec 2024 01:43:27 +0800 Subject: [PATCH 11/11] [update] update --- lib/routes/papers/query.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/routes/papers/query.ts b/lib/routes/papers/query.ts index b3555e9f035226..94f582a9264081 100644 --- a/lib/routes/papers/query.ts +++ b/lib/routes/papers/query.ts @@ -16,9 +16,8 @@ export const handler = async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 150; const rootUrl = 'https://papers.cool'; - const query = keyword.split(/\//)[1]; - const currentUrl = new URL(`arxiv/search?highlight=1&query=${query}&sort=0`, rootUrl).href; - const feedUrl = new URL(`arxiv/search/feed?query=${query}`, rootUrl).href; + const currentUrl = new URL(`arxiv/search?highlight=1&query=${keyword}&sort=0`, rootUrl).href; + const feedUrl = new URL(`arxiv/search/feed?query=${keyword}`, rootUrl).href; const site = keyword.split(/\//)[0]; const apiKimiUrl = new URL(`${site}/kimi?paper=`, rootUrl).href;