Fix extension bugs (#23)
* feat: cleaning supplemental elements in nytimes (visible in web only) closes https://github.com/postlight/mercury-reader-chrome-extension/issues/102 * wip * fix: more generous date published bits * feat: added washington post extractor (including figure transforms) closes https://github.com/postlight/mercury-reader-chrome-extension/issues/100 * feat: cleaning zoom lightbox from gizmodo/kinja * lint fixpull/24/head^2
parent
3a2f32b0eb
commit
a8face796a
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,61 @@
|
||||
export const WwwWashingtonpostComExtractor = {
|
||||
domain: 'www.washingtonpost.com',
|
||||
|
||||
title: {
|
||||
selectors: [
|
||||
'h1',
|
||||
'#topper-headline-wrapper',
|
||||
],
|
||||
},
|
||||
|
||||
author: {
|
||||
selectors: [
|
||||
'.pb-byline',
|
||||
],
|
||||
},
|
||||
|
||||
date_published: {
|
||||
selectors: [
|
||||
['.pb-timestamp[itemprop="datePublished"]', 'content'],
|
||||
],
|
||||
},
|
||||
|
||||
dek: {
|
||||
selectors: [
|
||||
['meta[name="og:description"]', 'value'],
|
||||
],
|
||||
},
|
||||
|
||||
lead_image_url: {
|
||||
selectors: [
|
||||
['meta[name="og:image"]', 'value'],
|
||||
],
|
||||
},
|
||||
|
||||
content: {
|
||||
selectors: [
|
||||
'.article-body',
|
||||
],
|
||||
|
||||
// Is there anything in the content you selected that needs transformed
|
||||
// before it's consumable content? E.g., unusual lazy loaded images
|
||||
transforms: {
|
||||
'div.inline-content': ($node) => {
|
||||
if ($node.has('img,iframe,video').length > 0) {
|
||||
return 'figure';
|
||||
}
|
||||
|
||||
$node.remove();
|
||||
return null;
|
||||
},
|
||||
'.pb-caption': 'figcaption',
|
||||
},
|
||||
|
||||
// Is there anything that is in the result that shouldn't be?
|
||||
// The clean selectors will remove anything that matches from
|
||||
// the result
|
||||
clean: [
|
||||
'.interstitial-link',
|
||||
],
|
||||
},
|
||||
};
|
Loading…
Reference in New Issue