From dc922a01f1f75daed0d071467b2b096a41c151b4 Mon Sep 17 00:00:00 2001 From: nczitzk <42264778+nczitzk@users.noreply.github.com> Date: Mon, 23 Oct 2023 22:32:00 +0800 Subject: [PATCH 1/3] feat(route): add ThoughtCo --- lib/v2/thoughtco/index.js | 95 +++++++ lib/v2/thoughtco/maintainer.js | 3 + lib/v2/thoughtco/radar.js | 155 +++++++++++ lib/v2/thoughtco/router.js | 3 + lib/v2/thoughtco/templates/description.art | 16 ++ website/docs/routes/new-media.md | 305 +++++++++++++++++++++ 6 files changed, 577 insertions(+) create mode 100644 lib/v2/thoughtco/index.js create mode 100644 lib/v2/thoughtco/maintainer.js create mode 100644 lib/v2/thoughtco/radar.js create mode 100644 lib/v2/thoughtco/router.js create mode 100644 lib/v2/thoughtco/templates/description.art diff --git a/lib/v2/thoughtco/index.js b/lib/v2/thoughtco/index.js new file mode 100644 index 00000000000000..c960f78aabd438 --- /dev/null +++ b/lib/v2/thoughtco/index.js @@ -0,0 +1,95 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); +const { art } = require('@/utils/render'); +const path = require('path'); + +module.exports = async (ctx) => { + const { category = '' } = ctx.params; + const limit = ctx.query.limit ? parseInt(ctx.query.limit, 10) : 50; + + const rootUrl = 'https://www.thoughtco.com'; + const currentUrl = new URL(category, rootUrl).href; + + const { data: response } = await got(currentUrl); + + const $ = cheerio.load(response); + + let items = $('a[data-doc-id]') + .slice(0, limit) + .toArray() + .map((item) => { + item = $(item); + + return { + title: item.find('span.block-title').text(), + link: new URL(item.prop('href'), rootUrl).href, + }; + }); + + items = await Promise.all( + items.map((item) => + ctx.cache.tryGet(item.link, async () => { + const { data: detailResponse } = await got(item.link); + + const content = cheerio.load(detailResponse); + + content('div.adslot').remove(); + content('div.sources-and-citation').remove(); + content('div.figure-media').each((_, e) => { + e = $(e); + + const image = e.find('img'); + + e.replaceWith( + art(path.join(__dirname, 'templates/description.art'), { + image: { + src: image.prop('data-src'), + width: image.prop('width'), + height: image.prop('height'), + }, + }) + ); + }); + + item.title = content('meta[property="og:title"]').prop('content'); + item.description = art(path.join(__dirname, 'templates/description.art'), { + image: { + src: content('meta[property="og:image"]').prop('content'), + }, + description: content('div.article-content').html(), + }); + item.author = content('meta[name="sailthru.author"]').prop('content'); + item.category = Array.from( + new Set( + content('meta[name="parsely-tags"]') + .prop('content') + .split(/,/) + .map((c) => c.trim()) + ) + ); + item.pubDate = parseDate(detailResponse.match(/"datePublished": "(.*?)"/)[1]); + item.updated = parseDate(detailResponse.match(/"dateModified": "(.*?)"/)[1]); + + return item; + }) + ) + ); + + const author = $('meta[property="og:site_name"]').prop('content'); + const title = $('meta[property="og:title"]').prop('content'); + const icon = new URL($('link[rel="apple-touch-icon-precomposed"]').prop('href'), rootUrl).href; + + ctx.state.data = { + item: items, + title: `${author}${title.startsWith(author) ? '' : ` - ${title}`}`, + link: currentUrl, + description: $('meta[property="og:description"]').prop('content'), + language: $('html').prop('lang'), + image: $('meta[property="og:image"]').prop('content'), + icon, + logo: icon, + subtitle: $('meta[property="og:title"]').prop('content'), + author, + }; +}; diff --git a/lib/v2/thoughtco/maintainer.js b/lib/v2/thoughtco/maintainer.js new file mode 100644 index 00000000000000..81eb78d7328b63 --- /dev/null +++ b/lib/v2/thoughtco/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/:category?': ['nczitzk'], +}; diff --git a/lib/v2/thoughtco/radar.js b/lib/v2/thoughtco/radar.js new file mode 100644 index 00000000000000..ed303dc65ababb --- /dev/null +++ b/lib/v2/thoughtco/radar.js @@ -0,0 +1,155 @@ +module.exports = { + 'thoughtco.com': { + _name: 'ThoughtCo', + '.': [ + { + title: 'Category', + docs: 'https://docs.rsshub.app/routes/new-media#thoughtco-category', + source: ['/:category'], + target: (params) => { + const category = params.category; + + return `/thoughtco${category ? `/${category}` : ''}`; + }, + }, + { + title: 'Science, Tech, Math - Science', + docs: 'https://docs.rsshub.app/routes/new-media#thoughtco-category-science-tech-math', + source: ['/science-4132464'], + target: '/thoughtco/science-4132464', + }, + { + title: 'Science, Tech, Math - Math', + docs: 'https://docs.rsshub.app/routes/new-media#thoughtco-category-science-tech-math', + source: ['/math-4133545'], + target: '/thoughtco/math-4133545', + }, + { + title: 'Science, Tech, Math - Social Sciences', + docs: 'https://docs.rsshub.app/routes/new-media#thoughtco-category-science-tech-math', + source: ['/social-sciences-4133522'], + target: '/thoughtco/social-sciences-4133522', + }, + { + title: 'Science, Tech, Math - Computer Science', + docs: 'https://docs.rsshub.app/routes/new-media#thoughtco-category-science-tech-math', + source: ['/computer-science-4133486'], + target: '/thoughtco/computer-science-4133486', + }, + { + title: 'Science, Tech, Math - Animals & Nature', + docs: 'https://docs.rsshub.app/routes/new-media#thoughtco-category-science-tech-math', + source: ['/animals-and-nature-4133421'], + target: '/thoughtco/animals-and-nature-4133421', + }, + { + title: 'Humanities - History & Culture', + docs: 'https://docs.rsshub.app/routes/new-media#thoughtco-category-humanities', + source: ['/history-and-culture-4133356'], + target: '/thoughtco/history-and-culture-4133356', + }, + { + title: 'Humanities - Visual Arts', + docs: 'https://docs.rsshub.app/routes/new-media#thoughtco-category-humanities', + source: ['/visual-arts-4132957'], + target: '/thoughtco/visual-arts-4132957', + }, + { + title: 'Humanities - Literature', + docs: 'https://docs.rsshub.app/routes/new-media#thoughtco-category-humanities', + source: ['/literature-4133251'], + target: '/thoughtco/literature-4133251', + }, + { + title: 'Humanities - English', + docs: 'https://docs.rsshub.app/routes/new-media#thoughtco-category-humanities', + source: ['/english-4688281'], + target: '/thoughtco/english-4688281', + }, + { + title: 'Humanities - Geography', + docs: 'https://docs.rsshub.app/routes/new-media#thoughtco-category-humanities', + source: ['/geography-4133035'], + target: '/thoughtco/geography-4133035', + }, + { + title: 'Humanities - Philosophy', + docs: 'https://docs.rsshub.app/routes/new-media#thoughtco-category-humanities', + source: ['/philosophy-4133025'], + target: '/thoughtco/philosophy-4133025', + }, + { + title: 'Humanities - Issues', + docs: 'https://docs.rsshub.app/routes/new-media#thoughtco-category-humanities', + source: ['/issues-4133022'], + target: '/thoughtco/issues-4133022', + }, + { + title: 'Languages - English as a Second Language', + docs: 'https://docs.rsshub.app/routes/new-media#thoughtco-category-languages', + source: ['/esl-4133095'], + target: '/thoughtco/esl-4133095', + }, + { + title: 'Languages - Spanish', + docs: 'https://docs.rsshub.app/routes/new-media#thoughtco-category-languages', + source: ['/spanish-4133085'], + target: '/thoughtco/spanish-4133085', + }, + { + title: 'Languages - French', + docs: 'https://docs.rsshub.app/routes/new-media#thoughtco-category-languages', + source: ['/french-4133079'], + target: '/thoughtco/french-4133079', + }, + { + title: 'Languages - German', + docs: 'https://docs.rsshub.app/routes/new-media#thoughtco-category-languages', + source: ['/german-4133073'], + target: '/thoughtco/german-4133073', + }, + { + title: 'Languages - Italian', + docs: 'https://docs.rsshub.app/routes/new-media#thoughtco-category-languages', + source: ['/italian-4133069'], + target: '/thoughtco/italian-4133069', + }, + { + title: 'Languages - Japanese', + docs: 'https://docs.rsshub.app/routes/new-media#thoughtco-category-languages', + source: ['/japanese-4133062'], + target: '/thoughtco/japanese-4133062', + }, + { + title: 'Languages - Mandarin', + docs: 'https://docs.rsshub.app/routes/new-media#thoughtco-category-languages', + source: ['/mandarin-4133057'], + target: '/thoughtco/mandarin-4133057', + }, + { + title: 'Languages - Russian', + docs: 'https://docs.rsshub.app/routes/new-media#thoughtco-category-languages', + source: ['/russian-4175265'], + target: '/thoughtco/russian-4175265', + }, + { + title: 'Resources - For Students & Parents', + docs: 'https://docs.rsshub.app/routes/new-media#thoughtco-category-resources', + source: ['/for-students-parents-4132588'], + target: '/thoughtco/for-students-parents-4132588', + }, + { + title: 'Resources - For Educators', + docs: 'https://docs.rsshub.app/routes/new-media#thoughtco-category-resources', + source: ['/for-educators-4132509'], + target: '/thoughtco/for-educators-4132509', + }, + { + title: 'Resources - For Adult Learners', + docs: 'https://docs.rsshub.app/routes/new-media#thoughtco-category-resources', + source: ['/for-adult-learners-4132469'], + target: '/thoughtco/for-adult-learners-4132469', + }, + ], + }, +}; diff --git a/lib/v2/thoughtco/router.js b/lib/v2/thoughtco/router.js new file mode 100644 index 00000000000000..19b84c05d31da0 --- /dev/null +++ b/lib/v2/thoughtco/router.js @@ -0,0 +1,3 @@ +module.exports = (router) => { + router.get('/:category?', require('./')); +}; diff --git a/lib/v2/thoughtco/templates/description.art b/lib/v2/thoughtco/templates/description.art new file mode 100644 index 00000000000000..1eac078aef91f9 --- /dev/null +++ b/lib/v2/thoughtco/templates/description.art @@ -0,0 +1,16 @@ +{{ if image }} +
+ +
+{{ /if }} + +{{ if description }} + {{@ description }} +{{ /if }} \ No newline at end of file diff --git a/website/docs/routes/new-media.md b/website/docs/routes/new-media.md index 7e1bbcdf240aa4..20c463e5b01f4d 100644 --- a/website/docs/routes/new-media.md +++ b/website/docs/routes/new-media.md @@ -2097,6 +2097,311 @@ Provides a better reading experience (full text articles) over the official one. +## ThoughtCo {#thoughtco} + +### Category {#thoughtco-category} + + + +#### Science, Tech, Math {#thoughtco-category-science-tech-math} + +| category | id | +| ---------------- | -------------------------- | +| Science | science-4132464 | +| Math | math-4133545 | +| Social Sciences | social-sciences-4133522 | +| Computer Science | computer-science-4133486 | +| Animals & Nature | animals-and-nature-4133421 | + +#### Humanities {#thoughtco-category-humanities} + +| category | id | +| ----------------- | --------------------------- | +| History & Culture | history-and-culture-4133356 | +| Visual Arts | visual-arts-4132957 | +| Literature | literature-4133251 | +| English | english-4688281 | +| Geography | geography-4133035 | +| Philosophy | philosophy-4133025 | +| Issues | issues-4133022 | + +#### Languages {#thoughtco-category-languages} + +| category | id | +| ---------------------------- | ---------------- | +| English as a Second Language | esl-4133095 | +| Spanish | spanish-4133085 | +| French | french-4133079 | +| German | german-4133073 | +| Italian | italian-4133069 | +| Japanese | japanese-4133062 | +| Mandarin | mandarin-4133057 | +| Russian | russian-4175265 | + +#### Resources {#thoughtco-category-resources} + +| category | id | +| ---------------------- | ---------------------------- | +| For Students & Parents | for-students-parents-4132588 | +| For Educators | for-educators-4132509 | +| For Adult Learners | for-adult-learners-4132469 | + +
+ More categories + + #### Science + + | category | id | + | ----------------- | --------------------------- | + | Chemistry | chemistry-4133594 | + | Biology | biology-4133580 | + | Physics | physics-4133571 | + | Geology | geology-4133564 | + | Astronomy | astronomy-4133558 | + | Weather & Climate | weather-and-climate-4133550 | + + #### Math + + | category | id | + | --------------------- | ------------------------------- | + | Math Tutorials | math-tutorials-4133543 | + | Geometry | geometry-4133540 | + | Arithmetic | arithmetic-4133542 | + | Pre Algebra & Algebra | pre-algebra-and-algebra-4133541 | + | Statistics | statistics-4133539 | + | Exponential Decay | exponential-decay-4133528 | + | Worksheets By Grade | worksheets-by-grade-4133526 | + | Resources | math-resources-4133523 | + + #### Social Sciences + + | category | id | + | ----------- | ------------------- | + | Psychology | psychology-4160512 | + | Sociology | sociology-4133515 | + | Archaeology | archaeology-4133504 | + | Economics | economics-4133521 | + | Ergonomics | ergonomics-4133492 | + + #### Computer Science + + | category | id | + | ---------------------- | -------------------------------- | + | PHP Programming | php-4133485 | + | Perl | perl-4133481 | + | Python | python-4133477 | + | Java Programming | java-programming-4133478 | + | Javascript Programming | javascript-programming-4133476 | + | Delphi Programming | delphi-programming-4133475 | + | C & C++ Programming | c-and-c-plus-programming-4133470 | + | Ruby Programming | ruby-programming-4133469 | + | Visual Basic | visual-basic-4133468 | + + #### Animals and Nature + + | category | id | + | ---------------- | ------------------------ | + | Amphibians | amphibians-4133418 | + | Birds | birds-4133416 | + | Habitat Profiles | habitat-profiles-4133412 | + | Mammals | mammals-4133411 | + | Reptiles | reptiles-4133408 | + | Insects | insects-4133406 | + | Marine Life | marine-life-4133393 | + | Forestry | forestry-4133386 | + | Dinosaurs | dinosaurs-4133376 | + | Evolution | evolution-4133366 | + + #### History and Culture + + | category | id | + | ------------------------------ | ---------------------------------------- | + | American History | american-history-4133354 | + | African American History | african-american-history-4133344 | + | African History | african-history-4133338 | + | Ancient History and Culture | ancient-history-4133336 | + | Asian History | asian-history-4133325 | + | European History | european-history-4133316 | + | Genealogy | genealogy-4133308 | + | Inventions | inventions-4133303 | + | Latin American History | latin-american-history-4133296 | + | Medieval & Renaissance History | medieval-and-renaissance-history-4133289 | + | Military History | military-history-4133285 | + | The 20th Century | 20th-century-4133273 | + | Women's History | womens-history-4133260 | + + #### Visual Arts + + | category | id | + | ------------- | -------------------- | + | Art & Artists | art-4132956 | + | Architecture | architecture-4132953 | + + #### Literature + + | category | id | + | ------------------ | -------------------------- | + | Best Sellers | best-sellers-4133250 | + | Classic Literature | classic-literature-4133245 | + | Plays & Drama | plays-and-drama-4133239 | + | Poetry | poetry-4133232 | + | Quotations | quotations-4133229 | + | Shakespeare | shakespeare-4133223 | + | Short Stories | short-stories-4133217 | + | Children's Books | childrens-books-4133216 | + + #### English + + | category | id | + | --------------- | ----------------------- | + | English Grammar | english-grammar-4133049 | + | Writing | writing-4133048 | + + #### Geography + + | category | id | + | ------------------------ | ---------------------------------- | + | Basics | geography-basics-4133034 | + | Physical Geography | physical-geography-4133032 | + | Political Geography | political-geography-4133033 | + | Population | population-4133031 | + | Country Information | country-information-4133030 | + | Key Figures & Milestones | key-figures-and-milestones-4133029 | + | Maps | maps-4133027 | + | Urban Geography | urban-geography-4133026 | + + #### Philosophy + + | category | id | + | ------------------------------ | ---------------------------------------- | + | Philosophical Theories & Ideas | philosophical-theories-and-ideas-4133024 | + | Major Philosophers | major-philosophers-4133023 | + + #### Issues + + | category | id | + | --------------------------------- | -------------------------------- | + | The U. S. Government | us-government-4133021 | + | U.S. Foreign Policy | us-foreign-policy-4133010 | + | U.S. Liberal Politics | us-liberal-politics-4133009 | + | U.S. Conservative Politics | us-conservative-politics-4133006 | + | Women's Issues | womens-issues-4133002 | + | Civil Liberties | civil-liberties-4132996 | + | The Middle East | middle-east-4132989 | + | Race Relations | race-relations-4132982 | + | Immigration | immigration-4132977 | + | Crime & Punishment | crime-and-punishment-4132972 | + | Canadian Government | canadian-government-4132959 | + | Understanding Types of Government | types-of-government-5179107 | + + #### English as a Second Language + + | category | id | + | ---------------------------- | ------------------------------------------ | + | Pronunciation & Conversation | esl-pronunciation-and-conversation-4133093 | + | Vocabulary | esl-vocabulary-4133092 | + | Writing Skills | esl-writing-skills-4133091 | + | Reading Comprehension | esl-reading-comprehension-4133090 | + | Grammar | esl-grammar-4133089 | + | Business English | esl-business-english-4133088 | + | Resources for Teachers | resources-for-esl-teachers-4133087 | + + #### Spanish + + | category | id | + | ----------------- | ----------------------------------- | + | History & Culture | spanish-history-and-culture-4133084 | + | Pronunciation | spanish-pronunciation-4133083 | + | Vocabulary | spanish-vocabulary-4133082 | + | Writing Skills | spanish-writing-skills-4133081 | + | Grammar | spanish-grammar-4133080 | + + #### French + + | category | id | + | ---------------------------- | -------------------------------------------- | + | Pronunciation & Conversation | french-pronunciation-4133075 | + | Vocabulary | french-vocabulary-4133076 | + | Grammar | french-grammar-4133074 | + | Resources For Teachers | french-resources-for-french-teachers-4133077 | + + #### German + + | category | id | + | ---------------------------- | ---------------------------------- | + | History & Culture | german-history-and-culture-4133071 | + | Pronunciation & Conversation | german-pronunciation-4133070 | + | Vocabulary | german-vocabulary-4133068 | + | Grammar | german-grammar-4133067 | + + #### Italian + + | category | id | + | ----------------- | ----------------------------------- | + | History & Culture | italian-history-and-culture-4133065 | + | Vocabulary | italian-vocabulary-4133061 | + | Grammar | italian-grammar-4133063 | + + #### Japanese + + | category | id | + | ----------------------------- | ------------------------------------ | + | History & Culture | japanese-history-and-culture-4133058 | + | Essential Japanese Vocabulary | japanese-vocabulary-4133060 | + | Japanese Grammar | japanese-grammar-4133056 | + + #### Mandarin + + | category | id | + | -------------------------------- | ---------------------------------------- | + | Mandarin History and Culture | mandarin-history-and-culture-4133054 | + | Pronunciation | mandarin-pronunciation-4133053 | + | Vocabulary | mandarin-vocabulary-4133052 | + | Understanding Chinese Characters | understanding-chinese-characters-4133051 | + + #### Russian + + | category | id | + | -------- | --------------- | + | Russian | russian-4175265 | + + #### For Students & Parents + + | category | id | + | ------------------ | -------------------------- | + | Homework Help | homework-help-4132587 | + | Private School | private-school-4132514 | + | Test Prep | test-prep-4132578 | + | College Admissions | college-admissions-4132565 | + | College Life | college-life-4132553 | + | Graduate School | graduate-school-4132543 | + | Business School | business-school-4132536 | + | Law School | law-school-4132527 | + | Distance Learning | distance-learning-4132521 | + + #### For Educators + + | category | id | + | -------------------- | ----------------------------- | + | Becoming A Teacher | becoming-a-teacher-4132510 | + | Assessments & Tests | assessments-and-tests-4132508 | + | Elementary Education | elementary-education-4132507 | + | Secondary Education | secondary-education-4132504 | + | Special Education | special-education-4132499 | + | Teaching | teaching-4132488 | + | Homeschooling | homeschooling-4132480 | + + #### For Adult Learners + + | category | id | + | ----------------------- | ------------------------------- | + | Tips For Adult Students | tips-for-adult-students-4132468 | + | Getting Your Ged | getting-your-ged-4132466 | + +
+ +
+ ## Thrillist {#thrillist} From f87ca5706231982d292c8105532fc7dd7c8faab8 Mon Sep 17 00:00:00 2001 From: TonyRL Date: Tue, 24 Oct 2023 13:12:49 +0000 Subject: [PATCH 2/3] docs: fix heading --- website/docs/routes/new-media.md | 46 ++++++++++++++++---------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/website/docs/routes/new-media.md b/website/docs/routes/new-media.md index 20c463e5b01f4d..73c185454919dc 100644 --- a/website/docs/routes/new-media.md +++ b/website/docs/routes/new-media.md @@ -2149,7 +2149,7 @@ Provides a better reading experience (full text articles) over the official one.
More categories - #### Science +#### Science {#thoughtco-category-science} | category | id | | ----------------- | --------------------------- | @@ -2160,7 +2160,7 @@ Provides a better reading experience (full text articles) over the official one. | Astronomy | astronomy-4133558 | | Weather & Climate | weather-and-climate-4133550 | - #### Math +#### Math {#thoughtco-category-math} | category | id | | --------------------- | ------------------------------- | @@ -2173,7 +2173,7 @@ Provides a better reading experience (full text articles) over the official one. | Worksheets By Grade | worksheets-by-grade-4133526 | | Resources | math-resources-4133523 | - #### Social Sciences +#### Social Sciences {#thoughtco-category-social-sciences} | category | id | | ----------- | ------------------- | @@ -2183,7 +2183,7 @@ Provides a better reading experience (full text articles) over the official one. | Economics | economics-4133521 | | Ergonomics | ergonomics-4133492 | - #### Computer Science +#### Computer Science {#thoughtco-category-computer-science} | category | id | | ---------------------- | -------------------------------- | @@ -2197,7 +2197,7 @@ Provides a better reading experience (full text articles) over the official one. | Ruby Programming | ruby-programming-4133469 | | Visual Basic | visual-basic-4133468 | - #### Animals and Nature +#### Animals and Nature {#thoughtco-category-animals-and-nature} | category | id | | ---------------- | ------------------------ | @@ -2212,7 +2212,7 @@ Provides a better reading experience (full text articles) over the official one. | Dinosaurs | dinosaurs-4133376 | | Evolution | evolution-4133366 | - #### History and Culture +#### History and Culture {#thoughtco-category-history-and-culture} | category | id | | ------------------------------ | ---------------------------------------- | @@ -2230,14 +2230,14 @@ Provides a better reading experience (full text articles) over the official one. | The 20th Century | 20th-century-4133273 | | Women's History | womens-history-4133260 | - #### Visual Arts +#### Visual Arts {#thoughtco-category-visual-arts} | category | id | | ------------- | -------------------- | | Art & Artists | art-4132956 | | Architecture | architecture-4132953 | - #### Literature +#### Literature {#thoughtco-category-literature} | category | id | | ------------------ | -------------------------- | @@ -2250,14 +2250,14 @@ Provides a better reading experience (full text articles) over the official one. | Short Stories | short-stories-4133217 | | Children's Books | childrens-books-4133216 | - #### English +#### English {#thoughtco-category-english} | category | id | | --------------- | ----------------------- | | English Grammar | english-grammar-4133049 | | Writing | writing-4133048 | - #### Geography +#### Geography {#thoughtco-category-geography} | category | id | | ------------------------ | ---------------------------------- | @@ -2270,14 +2270,14 @@ Provides a better reading experience (full text articles) over the official one. | Maps | maps-4133027 | | Urban Geography | urban-geography-4133026 | - #### Philosophy +#### Philosophy {#thoughtco-category-philosophy} | category | id | | ------------------------------ | ---------------------------------------- | | Philosophical Theories & Ideas | philosophical-theories-and-ideas-4133024 | | Major Philosophers | major-philosophers-4133023 | - #### Issues +#### Issues {#thoughtco-category-issues} | category | id | | --------------------------------- | -------------------------------- | @@ -2294,7 +2294,7 @@ Provides a better reading experience (full text articles) over the official one. | Canadian Government | canadian-government-4132959 | | Understanding Types of Government | types-of-government-5179107 | - #### English as a Second Language +#### English as a Second Language {#thoughtco-category-english-as-a-second-language} | category | id | | ---------------------------- | ------------------------------------------ | @@ -2306,7 +2306,7 @@ Provides a better reading experience (full text articles) over the official one. | Business English | esl-business-english-4133088 | | Resources for Teachers | resources-for-esl-teachers-4133087 | - #### Spanish +#### Spanish {#thoughtco-category-spanish} | category | id | | ----------------- | ----------------------------------- | @@ -2316,7 +2316,7 @@ Provides a better reading experience (full text articles) over the official one. | Writing Skills | spanish-writing-skills-4133081 | | Grammar | spanish-grammar-4133080 | - #### French +#### French {#thoughtco-category-french} | category | id | | ---------------------------- | -------------------------------------------- | @@ -2325,7 +2325,7 @@ Provides a better reading experience (full text articles) over the official one. | Grammar | french-grammar-4133074 | | Resources For Teachers | french-resources-for-french-teachers-4133077 | - #### German +#### German {#thoughtco-category-german} | category | id | | ---------------------------- | ---------------------------------- | @@ -2334,7 +2334,7 @@ Provides a better reading experience (full text articles) over the official one. | Vocabulary | german-vocabulary-4133068 | | Grammar | german-grammar-4133067 | - #### Italian +#### Italian {#thoughtco-category-italian} | category | id | | ----------------- | ----------------------------------- | @@ -2342,7 +2342,7 @@ Provides a better reading experience (full text articles) over the official one. | Vocabulary | italian-vocabulary-4133061 | | Grammar | italian-grammar-4133063 | - #### Japanese +#### Japanese {#thoughtco-category-japanese} | category | id | | ----------------------------- | ------------------------------------ | @@ -2350,7 +2350,7 @@ Provides a better reading experience (full text articles) over the official one. | Essential Japanese Vocabulary | japanese-vocabulary-4133060 | | Japanese Grammar | japanese-grammar-4133056 | - #### Mandarin +#### Mandarin {#thoughtco-category-mandarin} | category | id | | -------------------------------- | ---------------------------------------- | @@ -2359,13 +2359,13 @@ Provides a better reading experience (full text articles) over the official one. | Vocabulary | mandarin-vocabulary-4133052 | | Understanding Chinese Characters | understanding-chinese-characters-4133051 | - #### Russian +#### Russian {#thoughtco-category-russian} | category | id | | -------- | --------------- | | Russian | russian-4175265 | - #### For Students & Parents +#### For Students & Parents {#thoughtco-category-for-students-parents} | category | id | | ------------------ | -------------------------- | @@ -2379,7 +2379,7 @@ Provides a better reading experience (full text articles) over the official one. | Law School | law-school-4132527 | | Distance Learning | distance-learning-4132521 | - #### For Educators +#### For Educators {#thoughtco-category-for-educators} | category | id | | -------------------- | ----------------------------- | @@ -2391,7 +2391,7 @@ Provides a better reading experience (full text articles) over the official one. | Teaching | teaching-4132488 | | Homeschooling | homeschooling-4132480 | - #### For Adult Learners +#### For Adult Learners {#thoughtco-category-for-adult-learners} | category | id | | ----------------------- | ------------------------------- | From f3e4c1abd06d38550b44ccb04375e9d60fee8ca5 Mon Sep 17 00:00:00 2001 From: Ethan Shen <42264778+nczitzk@users.noreply.github.com> Date: Tue, 24 Oct 2023 23:58:40 +0800 Subject: [PATCH 3/3] update lib/v2/thoughtco/index.js Co-authored-by: Tony --- lib/v2/thoughtco/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/v2/thoughtco/index.js b/lib/v2/thoughtco/index.js index c960f78aabd438..ba83a8c7a5d669 100644 --- a/lib/v2/thoughtco/index.js +++ b/lib/v2/thoughtco/index.js @@ -35,7 +35,7 @@ module.exports = async (ctx) => { const content = cheerio.load(detailResponse); content('div.adslot').remove(); - content('div.sources-and-citation').remove(); + content('div.sources-and-citation, .mntl-figure-caption svg').remove(); content('div.figure-media').each((_, e) => { e = $(e);