Skip to content

Commit 697034c

Browse files
authored
Merge pull request #57 from fmacpro/development
Development
2 parents 4bde87f + 9a5478e commit 697034c

File tree

4 files changed

+11756
-4231
lines changed

4 files changed

+11756
-4231
lines changed

index.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,18 @@ const articleParser = async function (options, socket) {
247247

248248
return j('.permalink-tweet-container .js-tweet-text-container').html()
249249
})
250-
} else if (article.host === 'www.youtube.com') { // Youtube Content
250+
}
251+
else if (article.host === 'www.bbc.co.uk') { // BBC Content
252+
// BBC
253+
content = await page.evaluate(() => {
254+
var j = window.$
255+
256+
j('article section, article figure, article header').remove()
257+
258+
return j('article').html()
259+
})
260+
}
261+
else if (article.host === 'www.youtube.com') { // Youtube Content
251262
// Video Title
252263
article.title.text = await page.evaluate(() => {
253264
return window.ytInitialData.contents.twoColumnWatchNextResults.results.results.contents[0].videoPrimaryInfoRenderer.title.runs[0].text
@@ -256,7 +267,8 @@ const articleParser = async function (options, socket) {
256267
content = await page.evaluate(() => {
257268
return window.ytInitialData.contents.twoColumnWatchNextResults.results.results.contents[1].videoSecondaryInfoRenderer.description.runs[0].text
258269
})
259-
} else { // General Content
270+
}
271+
else { // General Content
260272
content = helpers.grabArticle(dom.window.document, false, options.regex).innerHTML
261273
}
262274

0 commit comments

Comments
 (0)