Skip to content

Commit

Permalink
Update common.js
Browse files Browse the repository at this point in the history
  • Loading branch information
dzx-dzx authored Sep 3, 2023
1 parent 055cad3 commit e520080
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/v2/reuters/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ module.exports = async (ctx) => {
if (!MUST_FETCH_BY_TOPICS.includes(category)) {
const rootUrl = 'https://www.reuters.com/pf/api/v3/content/fetch/articles-by-section-alias-or-id-v1';
const response = await got(
`${rootUrl}?query={${encodeURI(
rootUrl,{searchParams:{query:`{${encodeURI(
JSON.stringify({
offset: 0,
size: limit,
section_id,
website: 'reuters',
}).slice(1, -1)
)}}`
)}}`}}
).json();
return {
title: response.result.section.title,
Expand All @@ -33,14 +33,14 @@ module.exports = async (ctx) => {
} else {
const rootUrl = 'https://www.reuters.com/pf/api/v3/content/fetch/articles-by-topic-v1';
const response = await got(
`${rootUrl}?query={${encodeURI(
rootUrl,{searchParams:{query=:`{${encodeURI(
JSON.stringify({
offset: 0,
size: limit,
topic_url: section_id,
website: 'reuters',
}).slice(1, -1)
)}}`
)}}`}}
).json();

return {
Expand Down

0 comments on commit e520080

Please sign in to comment.