mercury-parser/dist/generate-custom-parser.js.map
2019-01-15 15:41:18 -08:00

1 line
434 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{"version":3,"file":null,"sources":["../src/utils/dom/constants.js","../src/utils/dom/brs-to-ps.js","../src/utils/dom/paragraphize.js","../src/utils/dom/convert-to-paragraphs.js","../src/utils/dom/convert-node-to.js","../src/utils/dom/clean-images.js","../src/utils/dom/strip-junk-tags.js","../src/utils/dom/clean-attributes.js","../src/extractors/generic/content/scoring/constants.js","../src/extractors/generic/content/scoring/get-weight.js","../src/extractors/generic/content/scoring/get-score.js","../src/extractors/generic/content/scoring/score-commas.js","../src/extractors/generic/content/scoring/score-length.js","../src/extractors/generic/content/scoring/score-paragraph.js","../src/extractors/generic/content/scoring/set-score.js","../src/extractors/generic/content/scoring/add-score.js","../src/extractors/generic/content/scoring/add-to-parent.js","../src/extractors/generic/content/scoring/get-or-init-score.js","../src/extractors/generic/content/scoring/score-node.js","../src/extractors/generic/content/scoring/score-content.js","../src/utils/text/normalize-spaces.js","../src/utils/text/extract-from-url.js","../src/utils/text/constants.js","../src/utils/text/article-base-url.js","../src/utils/text/has-sentence-end.js","../src/extractors/generic/content/scoring/merge-siblings.js","../src/extractors/generic/content/scoring/index.js","../src/utils/dom/clean-tags.js","../src/utils/dom/make-links-absolute.js","../src/utils/dom/link-density.js","../src/utils/dom/extract-from-selectors.js","../src/utils/dom/strip-tags.js","../src/utils/dom/within-comment.js","../src/utils/dom/node-is-sufficient.js","../src/utils/dom/get-attrs.js","../src/utils/dom/set-attr.js","../src/utils/dom/set-attrs.js","../src/utils/dom/index.js","mercury.js","../scripts/templates/insert-values.js","../scripts/templates/index.js","../scripts/templates/custom-extractor.js","../scripts/templates/custom-extractor-test.js","../scripts/generate-custom-parser.js"],"sourcesContent":["// Spacer images to be removed\nexport const SPACER_RE = new RegExp('transparent|spacer|blank', 'i');\n\n// The class we will use to mark elements we want to keep\n// but would normally remove\nexport const KEEP_CLASS = 'mercury-parser-keep';\n\nexport const KEEP_SELECTORS = [\n 'iframe[src^=\"https://www.youtube.com\"]',\n 'iframe[src^=\"https://www.youtube-nocookie.com\"]',\n 'iframe[src^=\"http://www.youtube.com\"]',\n 'iframe[src^=\"https://player.vimeo\"]',\n 'iframe[src^=\"http://player.vimeo\"]',\n];\n\n// A list of tags to strip from the output if we encounter them.\nexport const STRIP_OUTPUT_TAGS = [\n 'title',\n 'script',\n 'noscript',\n 'link',\n 'style',\n 'hr',\n 'embed',\n 'iframe',\n 'object',\n];\n\n// cleanAttributes\nexport const REMOVE_ATTRS = ['style', 'align'];\nexport const REMOVE_ATTR_SELECTORS = REMOVE_ATTRS.map(selector => `[${selector}]`);\nexport const REMOVE_ATTR_LIST = REMOVE_ATTRS.join(',');\nexport const WHITELIST_ATTRS = [\n 'src',\n 'srcset',\n 'href',\n 'class',\n 'id',\n 'alt',\n 'xlink:href',\n 'width',\n 'height',\n];\n\nexport const WHITELIST_ATTRS_RE = new RegExp(`^(${WHITELIST_ATTRS.join('|')})$`, 'i');\n\n// removeEmpty\nexport const REMOVE_EMPTY_TAGS = ['p'];\nexport const REMOVE_EMPTY_SELECTORS = REMOVE_EMPTY_TAGS.map(tag => `${tag}:empty`).join(',');\n\n// cleanTags\nexport const CLEAN_CONDITIONALLY_TAGS = ['ul', 'ol', 'table', 'div', 'button', 'form'].join(',');\n\n// cleanHeaders\nconst HEADER_TAGS = ['h2', 'h3', 'h4', 'h5', 'h6'];\nexport const HEADER_TAG_LIST = HEADER_TAGS.join(',');\n\n// // CONTENT FETCHING CONSTANTS ////\n\n// A list of strings that can be considered unlikely candidates when\n// extracting content from a resource. These strings are joined together\n// and then tested for existence using re:test, so may contain simple,\n// non-pipe style regular expression queries if necessary.\nexport const UNLIKELY_CANDIDATES_BLACKLIST = [\n 'ad-break',\n 'adbox',\n 'advert',\n 'addthis',\n 'agegate',\n 'aux',\n 'blogger-labels',\n 'combx',\n 'comment',\n 'conversation',\n 'disqus',\n 'entry-unrelated',\n 'extra',\n 'foot',\n // 'form', // This is too generic, has too many false positives\n 'header',\n 'hidden',\n 'loader',\n 'login', // Note: This can hit 'blogindex'.\n 'menu',\n 'meta',\n 'nav',\n 'outbrain',\n 'pager',\n 'pagination',\n 'predicta', // readwriteweb inline ad box\n 'presence_control_external', // lifehacker.com container full of false positives\n 'popup',\n 'printfriendly',\n 'related',\n 'remove',\n 'remark',\n 'rss',\n 'share',\n 'shoutbox',\n 'sidebar',\n 'sociable',\n 'sponsor',\n 'taboola',\n 'tools',\n];\n\n// A list of strings that can be considered LIKELY candidates when\n// extracting content from a resource. Essentially, the inverse of the\n// blacklist above - if something matches both blacklist and whitelist,\n// it is kept. This is useful, for example, if something has a className\n// of \"rss-content entry-content\". It matched 'rss', so it would normally\n// be removed, however, it's also the entry content, so it should be left\n// alone.\n//\n// These strings are joined together and then tested for existence using\n// re:test, so may contain simple, non-pipe style regular expression queries\n// if necessary.\nexport const UNLIKELY_CANDIDATES_WHITELIST = [\n 'and',\n 'article',\n 'body',\n 'blogindex',\n 'column',\n 'content',\n 'entry-content-asset',\n 'format', // misuse of form\n 'hfeed',\n 'hentry',\n 'hatom',\n 'main',\n 'page',\n 'posts',\n 'shadow',\n];\n\n// A list of tags which, if found inside, should cause a <div /> to NOT\n// be turned into a paragraph tag. Shallow div tags without these elements\n// should be turned into <p /> tags.\nexport const DIV_TO_P_BLOCK_TAGS = [\n 'a',\n 'blockquote',\n 'dl',\n 'div',\n 'img',\n 'p',\n 'pre',\n 'table',\n].join(',');\n\n// A list of tags that should be ignored when trying to find the top candidate\n// for a document.\nexport const NON_TOP_CANDIDATE_TAGS = [\n 'br',\n 'b',\n 'i',\n 'label',\n 'hr',\n 'area',\n 'base',\n 'basefont',\n 'input',\n 'img',\n 'link',\n 'meta',\n];\n\nexport const NON_TOP_CANDIDATE_TAGS_RE =\n new RegExp(`^(${NON_TOP_CANDIDATE_TAGS.join('|')})$`, 'i');\n\n// A list of selectors that specify, very clearly, either hNews or other\n// very content-specific style content, like Blogger templates.\n// More examples here: http://microformats.org/wiki/blog-post-formats\nexport const HNEWS_CONTENT_SELECTORS = [\n ['.hentry', '.entry-content'],\n ['entry', '.entry-content'],\n ['.entry', '.entry_content'],\n ['.post', '.postbody'],\n ['.post', '.post_body'],\n ['.post', '.post-body'],\n];\n\nexport const PHOTO_HINTS = [\n 'figure',\n 'photo',\n 'image',\n 'caption',\n];\nexport const PHOTO_HINTS_RE = new RegExp(PHOTO_HINTS.join('|'), 'i');\n\n// A list of strings that denote a positive scoring for this content as being\n// an article container. Checked against className and id.\n//\n// TODO: Perhaps have these scale based on their odds of being quality?\nexport const POSITIVE_SCORE_HINTS = [\n 'article',\n 'articlecontent',\n 'instapaper_body',\n 'blog',\n 'body',\n 'content',\n 'entry-content-asset',\n 'entry',\n 'hentry',\n 'main',\n 'Normal',\n 'page',\n 'pagination',\n 'permalink',\n 'post',\n 'story',\n 'text',\n '[-_]copy', // usatoday\n '\\\\Bcopy',\n];\n\n// The above list, joined into a matching regular expression\nexport const POSITIVE_SCORE_RE = new RegExp(POSITIVE_SCORE_HINTS.join('|'), 'i');\n\n// Readability publisher-specific guidelines\nexport const READABILITY_ASSET = new RegExp('entry-content-asset', 'i');\n\n// A list of strings that denote a negative scoring for this content as being\n// an article container. Checked against className and id.\n//\n// TODO: Perhaps have these scale based on their odds of being quality?\nexport const NEGATIVE_SCORE_HINTS = [\n 'adbox',\n 'advert',\n 'author',\n 'bio',\n 'bookmark',\n 'bottom',\n 'byline',\n 'clear',\n 'com-',\n 'combx',\n 'comment',\n 'comment\\\\B',\n 'contact',\n 'copy',\n 'credit',\n 'crumb',\n 'date',\n 'deck',\n 'excerpt',\n 'featured', // tnr.com has a featured_content which throws us off\n 'foot',\n 'footer',\n 'footnote',\n 'graf',\n 'head',\n 'info',\n 'infotext', // newscientist.com copyright\n 'instapaper_ignore',\n 'jump',\n 'linebreak',\n 'link',\n 'masthead',\n 'media',\n 'meta',\n 'modal',\n 'outbrain', // slate.com junk\n 'promo',\n 'pr_', // autoblog - press release\n 'related',\n 'respond',\n 'roundcontent', // lifehacker restricted content warning\n 'scroll',\n 'secondary',\n 'share',\n 'shopping',\n 'shoutbox',\n 'side',\n 'sidebar',\n 'sponsor',\n 'stamp',\n 'sub',\n 'summary',\n 'tags',\n 'tools',\n 'widget',\n];\n// The above list, joined into a matching regular expression\nexport const NEGATIVE_SCORE_RE = new RegExp(NEGATIVE_SCORE_HINTS.join('|'), 'i');\n\n// XPath to try to determine if a page is wordpress. Not always successful.\nexport const IS_WP_SELECTOR = 'meta[name=generator][value^=WordPress]';\n\n// Match a digit. Pretty clear.\nexport const DIGIT_RE = new RegExp('[0-9]');\n\n// A list of words that, if found in link text or URLs, likely mean that\n// this link is not a next page link.\nexport const EXTRANEOUS_LINK_HINTS = [\n 'print',\n 'archive',\n 'comment',\n 'discuss',\n 'e-mail',\n 'email',\n 'share',\n 'reply',\n 'all',\n 'login',\n 'sign',\n 'single',\n 'adx',\n 'entry-unrelated',\n];\nexport const EXTRANEOUS_LINK_HINTS_RE = new RegExp(EXTRANEOUS_LINK_HINTS.join('|'), 'i');\n\n// Match any phrase that looks like it could be page, or paging, or pagination\nexport const PAGE_RE = new RegExp('pag(e|ing|inat)', 'i');\n\n// Match any link text/classname/id that looks like it could mean the next\n// page. Things like: next, continue, >, >>, » but not >|, »| as those can\n// mean last page.\n// export const NEXT_LINK_TEXT_RE = new RegExp('(next|weiter|continue|>([^\\|]|$)|»([^\\|]|$))', 'i');\nexport const NEXT_LINK_TEXT_RE = /(next|weiter|continue|>([^|]|$)|»([^|]|$))/i;\n\n// Match any link text/classname/id that looks like it is an end link: things\n// like \"first\", \"last\", \"end\", etc.\nexport const CAP_LINK_TEXT_RE = new RegExp('(first|last|end)', 'i');\n\n// Match any link text/classname/id that looks like it means the previous\n// page.\nexport const PREV_LINK_TEXT_RE = new RegExp('(prev|earl|old|new|<|«)', 'i');\n\n// Match 2 or more consecutive <br> tags\nexport const BR_TAGS_RE = new RegExp('(<br[^>]*>[ \\n\\r\\t]*){2,}', 'i');\n\n// Match 1 BR tag.\nexport const BR_TAG_RE = new RegExp('<br[^>]*>', 'i');\n\n// A list of all of the block level tags known in HTML5 and below. Taken from\n// http://bit.ly/qneNIT\nexport const BLOCK_LEVEL_TAGS = [\n 'article',\n 'aside',\n 'blockquote',\n 'body',\n 'br',\n 'button',\n 'canvas',\n 'caption',\n 'col',\n 'colgroup',\n 'dd',\n 'div',\n 'dl',\n 'dt',\n 'embed',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'footer',\n 'form',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'header',\n 'hgroup',\n 'hr',\n 'li',\n 'map',\n 'object',\n 'ol',\n 'output',\n 'p',\n 'pre',\n 'progress',\n 'section',\n 'table',\n 'tbody',\n 'textarea',\n 'tfoot',\n 'th',\n 'thead',\n 'tr',\n 'ul',\n 'video',\n];\nexport const BLOCK_LEVEL_TAGS_RE = new RegExp(`^(${BLOCK_LEVEL_TAGS.join('|')})$`, 'i');\n\n// The removal is implemented as a blacklist and whitelist, this test finds\n// blacklisted elements that aren't whitelisted. We do this all in one\n// expression-both because it's only one pass, and because this skips the\n// serialization for whitelisted nodes.\nconst candidatesBlacklist = UNLIKELY_CANDIDATES_BLACKLIST.join('|');\nexport const CANDIDATES_BLACKLIST = new RegExp(candidatesBlacklist, 'i');\n\nconst candidatesWhitelist = UNLIKELY_CANDIDATES_WHITELIST.join('|');\nexport const CANDIDATES_WHITELIST = new RegExp(candidatesWhitelist, 'i');\n\nexport const UNLIKELY_RE = new RegExp(`!(${candidatesWhitelist})|(${candidatesBlacklist})`, 'i');\n\nexport const PARAGRAPH_SCORE_TAGS = new RegExp('^(p|li|span|pre)$', 'i');\nexport const CHILD_CONTENT_TAGS = new RegExp('^(td|blockquote|ol|ul|dl)$', 'i');\nexport const BAD_TAGS = new RegExp('^(address|form)$', 'i');\n\nexport const HTML_OR_BODY_RE = new RegExp('^(html|body)$', 'i');\n","import { paragraphize } from './index';\n\n// ## NOTES:\n// Another good candidate for refactoring/optimizing.\n// Very imperative code, I don't love it. - AP\n\n// Given cheerio object, convert consecutive <br /> tags into\n// <p /> tags instead.\n//\n// :param $: A cheerio object\n\nexport default function brsToPs($) {\n let collapsing = false;\n $('br').each((index, element) => {\n const $element = $(element);\n const nextElement = $element.next().get(0);\n\n if (nextElement && nextElement.tagName.toLowerCase() === 'br') {\n collapsing = true;\n $element.remove();\n } else if (collapsing) {\n collapsing = false;\n // $(element).replaceWith('<p />')\n paragraphize(element, $, true);\n }\n });\n\n return $;\n}\n","import { BLOCK_LEVEL_TAGS_RE } from './constants';\n\n// Given a node, turn it into a P if it is not already a P, and\n// make sure it conforms to the constraints of a P tag (I.E. does\n// not contain any other block tags.)\n//\n// If the node is a <br />, it treats the following inline siblings\n// as if they were its children.\n//\n// :param node: The node to paragraphize; this is a raw node\n// :param $: The cheerio object to handle dom manipulation\n// :param br: Whether or not the passed node is a br\n\nexport default function paragraphize(node, $, br = false) {\n const $node = $(node);\n\n if (br) {\n let sibling = node.nextSibling;\n const p = $('<p></p>');\n\n // while the next node is text or not a block level element\n // append it to a new p node\n while (sibling && !(sibling.tagName && BLOCK_LEVEL_TAGS_RE.test(sibling.tagName))) {\n const nextSibling = sibling.nextSibling;\n $(sibling).appendTo(p);\n sibling = nextSibling;\n }\n\n $node.replaceWith(p);\n $node.remove();\n return $;\n }\n\n return $;\n}\n","import { brsToPs, convertNodeTo } from 'utils/dom';\n\nimport { DIV_TO_P_BLOCK_TAGS } from './constants';\n\nfunction convertDivs($) {\n $('div').each((index, div) => {\n const $div = $(div);\n const convertable = $div.children(DIV_TO_P_BLOCK_TAGS).length === 0;\n\n if (convertable) {\n convertNodeTo($div, $, 'p');\n }\n });\n\n return $;\n}\n\nfunction convertSpans($) {\n $('span').each((index, span) => {\n const $span = $(span);\n const convertable = $span.parents('p, div').length === 0;\n if (convertable) {\n convertNodeTo($span, $, 'p');\n }\n });\n\n return $;\n}\n\n// Loop through the provided doc, and convert any p-like elements to\n// actual paragraph tags.\n//\n// Things fitting this criteria:\n// * Multiple consecutive <br /> tags.\n// * <div /> tags without block level elements inside of them\n// * <span /> tags who are not children of <p /> or <div /> tags.\n//\n// :param $: A cheerio object to search\n// :return cheerio object with new p elements\n// (By-reference mutation, though. Returned just for convenience.)\n\nexport default function convertToParagraphs($) {\n $ = brsToPs($);\n $ = convertDivs($);\n $ = convertSpans($);\n\n return $;\n}\n","import { getAttrs } from 'utils/dom';\n\nexport default function convertNodeTo($node, $, tag = 'p') {\n const node = $node.get(0);\n if (!node) {\n return $;\n }\n const attrs = getAttrs(node) || {};\n // console.log(attrs)\n\n const attribString = Reflect.ownKeys(attrs)\n .map(key => `${key}=${attrs[key]}`)\n .join(' ');\n let html;\n\n if ($.browser) {\n // In the browser, the contents of noscript tags aren't rendered, therefore\n // transforms on the noscript tag (commonly used for lazy-loading) don't work\n // as expected. This test case handles that\n html = node.tagName.toLowerCase() === 'noscript' ? $node.text() : $node.html();\n } else {\n html = $node.contents();\n }\n $node.replaceWith(\n `<${tag} ${attribString}>${html}</${tag}>`\n );\n return $;\n}\n","import { SPACER_RE } from './constants';\n\nfunction cleanForHeight($img, $) {\n const height = parseInt($img.attr('height'), 10);\n const width = parseInt($img.attr('width'), 10) || 20;\n\n // Remove images that explicitly have very small heights or\n // widths, because they are most likely shims or icons,\n // which aren't very useful for reading.\n if ((height || 20) < 10 || width < 10) {\n $img.remove();\n } else if (height) {\n // Don't ever specify a height on images, so that we can\n // scale with respect to width without screwing up the\n // aspect ratio.\n $img.removeAttr('height');\n }\n\n return $;\n}\n\n// Cleans out images where the source string matches transparent/spacer/etc\n// TODO This seems very aggressive - AP\nfunction removeSpacers($img, $) {\n if (SPACER_RE.test($img.attr('src'))) {\n $img.remove();\n }\n\n return $;\n}\n\nexport default function cleanImages($article, $) {\n $article.find('img').each((index, img) => {\n const $img = $(img);\n\n cleanForHeight($img, $);\n removeSpacers($img, $);\n });\n\n return $;\n}\n","import {\n STRIP_OUTPUT_TAGS,\n KEEP_CLASS,\n} from './constants';\n\nexport default function stripJunkTags(article, $, tags = []) {\n if (tags.length === 0) {\n tags = STRIP_OUTPUT_TAGS;\n }\n\n // Remove matching elements, but ignore\n // any element with a class of mercury-parser-keep\n $(tags.join(','), article).not(`.${KEEP_CLASS}`).remove();\n\n return $;\n}\n","import {\n getAttrs,\n setAttrs,\n} from 'utils/dom';\n\nimport {\n WHITELIST_ATTRS_RE,\n KEEP_CLASS,\n} from './constants';\n\nfunction removeAllButWhitelist($article, $) {\n $article.find('*').each((index, node) => {\n const attrs = getAttrs(node);\n\n setAttrs(node, Reflect.ownKeys(attrs).reduce((acc, attr) => {\n if (WHITELIST_ATTRS_RE.test(attr)) {\n return { ...acc, [attr]: attrs[attr] };\n }\n\n return acc;\n }, {}));\n });\n\n // Remove the mercury-parser-keep class from result\n $(`.${KEEP_CLASS}`, $article).removeClass(KEEP_CLASS);\n\n return $article;\n}\n\n// function removeAttrs(article, $) {\n// REMOVE_ATTRS.forEach((attr) => {\n// $(`[${attr}]`, article).removeAttr(attr);\n// });\n// }\n\n// Remove attributes like style or align\nexport default function cleanAttributes($article, $) {\n // Grabbing the parent because at this point\n // $article will be wrapped in a div which will\n // have a score set on it.\n return removeAllButWhitelist(\n $article.parent().length ? $article.parent() : $article,\n $,\n );\n}\n","// // CONTENT FETCHING CONSTANTS ////\n\n// A list of strings that can be considered unlikely candidates when\n// extracting content from a resource. These strings are joined together\n// and then tested for existence using re:test, so may contain simple,\n// non-pipe style regular expression queries if necessary.\nexport const UNLIKELY_CANDIDATES_BLACKLIST = [\n 'ad-break',\n 'adbox',\n 'advert',\n 'addthis',\n 'agegate',\n 'aux',\n 'blogger-labels',\n 'combx',\n 'comment',\n 'conversation',\n 'disqus',\n 'entry-unrelated',\n 'extra',\n 'foot',\n 'form',\n 'header',\n 'hidden',\n 'loader',\n 'login', // Note: This can hit 'blogindex'.\n 'menu',\n 'meta',\n 'nav',\n 'pager',\n 'pagination',\n 'predicta', // readwriteweb inline ad box\n 'presence_control_external', // lifehacker.com container full of false positives\n 'popup',\n 'printfriendly',\n 'related',\n 'remove',\n 'remark',\n 'rss',\n 'share',\n 'shoutbox',\n 'sidebar',\n 'sociable',\n 'sponsor',\n 'tools',\n];\n\n// A list of strings that can be considered LIKELY candidates when\n// extracting content from a resource. Essentially, the inverse of the\n// blacklist above - if something matches both blacklist and whitelist,\n// it is kept. This is useful, for example, if something has a className\n// of \"rss-content entry-content\". It matched 'rss', so it would normally\n// be removed, however, it's also the entry content, so it should be left\n// alone.\n//\n// These strings are joined together and then tested for existence using\n// re:test, so may contain simple, non-pipe style regular expression queries\n// if necessary.\nexport const UNLIKELY_CANDIDATES_WHITELIST = [\n 'and',\n 'article',\n 'body',\n 'blogindex',\n 'column',\n 'content',\n 'entry-content-asset',\n 'format', // misuse of form\n 'hfeed',\n 'hentry',\n 'hatom',\n 'main',\n 'page',\n 'posts',\n 'shadow',\n];\n\n// A list of tags which, if found inside, should cause a <div /> to NOT\n// be turned into a paragraph tag. Shallow div tags without these elements\n// should be turned into <p /> tags.\nexport const DIV_TO_P_BLOCK_TAGS = [\n 'a',\n 'blockquote',\n 'dl',\n 'div',\n 'img',\n 'p',\n 'pre',\n 'table',\n].join(',');\n\n// A list of tags that should be ignored when trying to find the top candidate\n// for a document.\nexport const NON_TOP_CANDIDATE_TAGS = [\n 'br',\n 'b',\n 'i',\n 'label',\n 'hr',\n 'area',\n 'base',\n 'basefont',\n 'input',\n 'img',\n 'link',\n 'meta',\n];\n\nexport const NON_TOP_CANDIDATE_TAGS_RE =\n new RegExp(`^(${NON_TOP_CANDIDATE_TAGS.join('|')})$`, 'i');\n\n// A list of selectors that specify, very clearly, either hNews or other\n// very content-specific style content, like Blogger templates.\n// More examples here: http://microformats.org/wiki/blog-post-formats\nexport const HNEWS_CONTENT_SELECTORS = [\n ['.hentry', '.entry-content'],\n ['entry', '.entry-content'],\n ['.entry', '.entry_content'],\n ['.post', '.postbody'],\n ['.post', '.post_body'],\n ['.post', '.post-body'],\n];\n\nexport const PHOTO_HINTS = [\n 'figure',\n 'photo',\n 'image',\n 'caption',\n];\nexport const PHOTO_HINTS_RE = new RegExp(PHOTO_HINTS.join('|'), 'i');\n\n// A list of strings that denote a positive scoring for this content as being\n// an article container. Checked against className and id.\n//\n// TODO: Perhaps have these scale based on their odds of being quality?\nexport const POSITIVE_SCORE_HINTS = [\n 'article',\n 'articlecontent',\n 'instapaper_body',\n 'blog',\n 'body',\n 'content',\n 'entry-content-asset',\n 'entry',\n 'hentry',\n 'main',\n 'Normal',\n 'page',\n 'pagination',\n 'permalink',\n 'post',\n 'story',\n 'text',\n '[-_]copy', // usatoday\n '\\\\Bcopy',\n];\n\n// The above list, joined into a matching regular expression\nexport const POSITIVE_SCORE_RE = new RegExp(POSITIVE_SCORE_HINTS.join('|'), 'i');\n\n// Readability publisher-specific guidelines\nexport const READABILITY_ASSET = new RegExp('entry-content-asset', 'i');\n\n// A list of strings that denote a negative scoring for this content as being\n// an article container. Checked against className and id.\n//\n// TODO: Perhaps have these scale based on their odds of being quality?\nexport const NEGATIVE_SCORE_HINTS = [\n 'adbox',\n 'advert',\n 'author',\n 'bio',\n 'bookmark',\n 'bottom',\n 'byline',\n 'clear',\n 'com-',\n 'combx',\n 'comment',\n 'comment\\\\B',\n 'contact',\n 'copy',\n 'credit',\n 'crumb',\n 'date',\n 'deck',\n 'excerpt',\n 'featured', // tnr.com has a featured_content which throws us off\n 'foot',\n 'footer',\n 'footnote',\n 'graf',\n 'head',\n 'info',\n 'infotext', // newscientist.com copyright\n 'instapaper_ignore',\n 'jump',\n 'linebreak',\n 'link',\n 'masthead',\n 'media',\n 'meta',\n 'modal',\n 'outbrain', // slate.com junk\n 'promo',\n 'pr_', // autoblog - press release\n 'related',\n 'respond',\n 'roundcontent', // lifehacker restricted content warning\n 'scroll',\n 'secondary',\n 'share',\n 'shopping',\n 'shoutbox',\n 'side',\n 'sidebar',\n 'sponsor',\n 'stamp',\n 'sub',\n 'summary',\n 'tags',\n 'tools',\n 'widget',\n];\n// The above list, joined into a matching regular expression\nexport const NEGATIVE_SCORE_RE = new RegExp(NEGATIVE_SCORE_HINTS.join('|'), 'i');\n\n// Match a digit. Pretty clear.\nexport const DIGIT_RE = new RegExp('[0-9]');\n\n// Match 2 or more consecutive <br> tags\nexport const BR_TAGS_RE = new RegExp('(<br[^>]*>[ \\n\\r\\t]*){2,}', 'i');\n\n// Match 1 BR tag.\nexport const BR_TAG_RE = new RegExp('<br[^>]*>', 'i');\n\n// A list of all of the block level tags known in HTML5 and below. Taken from\n// http://bit.ly/qneNIT\nexport const BLOCK_LEVEL_TAGS = [\n 'article',\n 'aside',\n 'blockquote',\n 'body',\n 'br',\n 'button',\n 'canvas',\n 'caption',\n 'col',\n 'colgroup',\n 'dd',\n 'div',\n 'dl',\n 'dt',\n 'embed',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'footer',\n 'form',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'header',\n 'hgroup',\n 'hr',\n 'li',\n 'map',\n 'object',\n 'ol',\n 'output',\n 'p',\n 'pre',\n 'progress',\n 'section',\n 'table',\n 'tbody',\n 'textarea',\n 'tfoot',\n 'th',\n 'thead',\n 'tr',\n 'ul',\n 'video',\n];\nexport const BLOCK_LEVEL_TAGS_RE = new RegExp(`^(${BLOCK_LEVEL_TAGS.join('|')})$`, 'i');\n\n// The removal is implemented as a blacklist and whitelist, this test finds\n// blacklisted elements that aren't whitelisted. We do this all in one\n// expression-both because it's only one pass, and because this skips the\n// serialization for whitelisted nodes.\nconst candidatesBlacklist = UNLIKELY_CANDIDATES_BLACKLIST.join('|');\nexport const CANDIDATES_BLACKLIST = new RegExp(candidatesBlacklist, 'i');\n\nconst candidatesWhitelist = UNLIKELY_CANDIDATES_WHITELIST.join('|');\nexport const CANDIDATES_WHITELIST = new RegExp(candidatesWhitelist, 'i');\n\nexport const UNLIKELY_RE = new RegExp(`!(${candidatesWhitelist})|(${candidatesBlacklist})`, 'i');\n\nexport const PARAGRAPH_SCORE_TAGS = new RegExp('^(p|li|span|pre)$', 'i');\nexport const CHILD_CONTENT_TAGS = new RegExp('^(td|blockquote|ol|ul|dl)$', 'i');\nexport const BAD_TAGS = new RegExp('^(address|form)$', 'i');\n\nexport const HTML_OR_BODY_RE = new RegExp('^(html|body)$', 'i');\n","import {\n NEGATIVE_SCORE_RE,\n POSITIVE_SCORE_RE,\n PHOTO_HINTS_RE,\n READABILITY_ASSET,\n} from './constants';\n\n// Get the score of a node based on its className and id.\nexport default function getWeight(node) {\n const classes = node.attr('class');\n const id = node.attr('id');\n let score = 0;\n\n if (id) {\n // if id exists, try to score on both positive and negative\n if (POSITIVE_SCORE_RE.test(id)) {\n score += 25;\n }\n if (NEGATIVE_SCORE_RE.test(id)) {\n score -= 25;\n }\n }\n\n if (classes) {\n if (score === 0) {\n // if classes exist and id did not contribute to score\n // try to score on both positive and negative\n if (POSITIVE_SCORE_RE.test(classes)) {\n score += 25;\n }\n if (NEGATIVE_SCORE_RE.test(classes)) {\n score -= 25;\n }\n }\n\n // even if score has been set by id, add score for\n // possible photo matches\n // \"try to keep photos if we can\"\n if (PHOTO_HINTS_RE.test(classes)) {\n score += 10;\n }\n\n // add 25 if class matches entry-content-asset,\n // a class apparently instructed for use in the\n // Readability publisher guidelines\n // https://www.readability.com/developers/guidelines\n if (READABILITY_ASSET.test(classes)) {\n score += 25;\n }\n }\n\n return score;\n}\n","// returns the score of a node based on\n// the node's score attribute\n// returns null if no score set\nexport default function getScore($node) {\n return parseFloat($node.attr('score')) || null;\n}\n","// return 1 for every comma in text\nexport default function scoreCommas(text) {\n return (text.match(/,/g) || []).length;\n}\n","const idkRe = new RegExp('^(p|pre)$', 'i');\n\nexport default function scoreLength(textLength, tagName = 'p') {\n const chunks = textLength / 50;\n\n if (chunks > 0) {\n let lengthBonus;\n\n // No idea why p or pre are being tamped down here\n // but just following the source for now\n // Not even sure why tagName is included here,\n // since this is only being called from the context\n // of scoreParagraph\n if (idkRe.test(tagName)) {\n lengthBonus = chunks - 2;\n } else {\n lengthBonus = chunks - 1.25;\n }\n\n return Math.min(Math.max(lengthBonus, 0), 3);\n }\n\n return 0;\n}\n","import {\n scoreCommas,\n scoreLength,\n} from './index';\n\n// Score a paragraph using various methods. Things like number of\n// commas, etc. Higher is better.\nexport default function scoreParagraph(node) {\n let score = 1;\n const text = node.text().trim();\n const textLength = text.length;\n\n // If this paragraph is less than 25 characters, don't count it.\n if (textLength < 25) {\n return 0;\n }\n\n // Add points for any commas within this paragraph\n score += scoreCommas(text);\n\n // For every 50 characters in this paragraph, add another point. Up\n // to 3 points.\n score += scoreLength(textLength);\n\n // Articles can end with short paragraphs when people are being clever\n // but they can also end with short paragraphs setting up lists of junk\n // that we strip. This negative tweaks junk setup paragraphs just below\n // the cutoff threshold.\n if (text.slice(-1) === ':') {\n score -= 1;\n }\n\n return score;\n}\n","export default function setScore($node, $, score) {\n $node.attr('score', score);\n return $node;\n}\n","import {\n getOrInitScore,\n setScore,\n} from './index';\n\nexport default function addScore($node, $, amount) {\n try {\n const score = getOrInitScore($node, $) + amount;\n setScore($node, $, score);\n } catch (e) {\n // Ignoring; error occurs in scoreNode\n }\n\n return $node;\n}\n","import { addScore } from './index';\n\n// Adds 1/4 of a child's score to its parent\nexport default function addToParent(node, $, score) {\n const parent = node.parent();\n if (parent) {\n addScore(parent, $, score * 0.25);\n }\n\n return node;\n}\n","import {\n getScore,\n scoreNode,\n getWeight,\n addToParent,\n} from './index';\n\n// gets and returns the score if it exists\n// if not, initializes a score based on\n// the node's tag type\nexport default function getOrInitScore($node, $, weightNodes = true) {\n let score = getScore($node);\n\n if (score) {\n return score;\n }\n\n score = scoreNode($node);\n\n if (weightNodes) {\n score += getWeight($node);\n }\n\n addToParent($node, $, score);\n\n return score;\n}\n","import { scoreParagraph } from './index';\nimport {\n PARAGRAPH_SCORE_TAGS,\n CHILD_CONTENT_TAGS,\n BAD_TAGS,\n} from './constants';\n\n// Score an individual node. Has some smarts for paragraphs, otherwise\n// just scores based on tag.\nexport default function scoreNode($node) {\n const { tagName } = $node.get(0);\n\n // TODO: Consider ordering by most likely.\n // E.g., if divs are a more common tag on a page,\n // Could save doing that regex test on every node AP\n if (PARAGRAPH_SCORE_TAGS.test(tagName)) {\n return scoreParagraph($node);\n } else if (tagName.toLowerCase() === 'div') {\n return 5;\n } else if (CHILD_CONTENT_TAGS.test(tagName)) {\n return 3;\n } else if (BAD_TAGS.test(tagName)) {\n return -3;\n } else if (tagName.toLowerCase() === 'th') {\n return -5;\n }\n\n return 0;\n}\n","import { convertNodeTo } from 'utils/dom';\n\nimport { HNEWS_CONTENT_SELECTORS } from './constants';\nimport {\n scoreNode,\n setScore,\n getOrInitScore,\n addScore,\n} from './index';\n\nfunction convertSpans($node, $) {\n if ($node.get(0)) {\n const { tagName } = $node.get(0);\n\n if (tagName === 'span') {\n // convert spans to divs\n convertNodeTo($node, $, 'div');\n }\n }\n}\n\nfunction addScoreTo($node, $, score) {\n if ($node) {\n convertSpans($node, $);\n addScore($node, $, score);\n }\n}\n\nfunction scorePs($, weightNodes) {\n $('p, pre').not('[score]').each((index, node) => {\n // The raw score for this paragraph, before we add any parent/child\n // scores.\n let $node = $(node);\n $node = setScore($node, $, getOrInitScore($node, $, weightNodes));\n\n const $parent = $node.parent();\n const rawScore = scoreNode($node);\n\n addScoreTo($parent, $, rawScore, weightNodes);\n if ($parent) {\n // Add half of the individual content score to the\n // grandparent\n addScoreTo($parent.parent(), $, rawScore / 2, weightNodes);\n }\n });\n\n return $;\n}\n\n// score content. Parents get the full value of their children's\n// content score, grandparents half\nexport default function scoreContent($, weightNodes = true) {\n // First, look for special hNews based selectors and give them a big\n // boost, if they exist\n HNEWS_CONTENT_SELECTORS.forEach(([parentSelector, childSelector]) => {\n $(`${parentSelector} ${childSelector}`).each((index, node) => {\n addScore($(node).parent(parentSelector), $, 80);\n });\n });\n\n // Doubling this again\n // Previous solution caused a bug\n // in which parents weren't retaining\n // scores. This is not ideal, and\n // should be fixed.\n scorePs($, weightNodes);\n scorePs($, weightNodes);\n\n return $;\n}\n","const NORMALIZE_RE = /\\s{2,}/g;\n\nexport default function normalizeSpaces(text) {\n return text.replace(NORMALIZE_RE, ' ').trim();\n}\n","// Given a node type to search for, and a list of regular expressions,\n// look to see if this extraction can be found in the URL. Expects\n// that each expression in r_list will return group(1) as the proper\n// string to be cleaned.\n// Only used for date_published currently.\nexport default function extractFromUrl(url, regexList) {\n const matchRe = regexList.find(re => re.test(url));\n if (matchRe) {\n return matchRe.exec(url)[1];\n }\n\n return null;\n}\n","// An expression that looks to try to find the page digit within a URL, if\n// it exists.\n// Matches:\n// page=1\n// pg=1\n// p=1\n// paging=12\n// pag=7\n// pagination/1\n// paging/88\n// pa/83\n// p/11\n//\n// Does not match:\n// pg=102\n// page:2\nexport const PAGE_IN_HREF_RE = new RegExp('(page|paging|(p(a|g|ag)?(e|enum|ewanted|ing|ination)))?(=|/)([0-9]{1,3})', 'i');\n\nexport const HAS_ALPHA_RE = /[a-z]/i;\n\nexport const IS_ALPHA_RE = /^[a-z]+$/i;\nexport const IS_DIGIT_RE = /^[0-9]+$/i;\n\nexport const ENCODING_RE = /charset=([\\w-]+)\\b/;\nexport const DEFAULT_ENCODING = 'utf-8';\n","import URL from 'url';\n\nimport {\n HAS_ALPHA_RE,\n IS_ALPHA_RE,\n IS_DIGIT_RE,\n PAGE_IN_HREF_RE,\n} from './constants';\n\nfunction isGoodSegment(segment, index, firstSegmentHasLetters) {\n let goodSegment = true;\n\n // If this is purely a number, and it's the first or second\n // url_segment, it's probably a page number. Remove it.\n if (index < 2 && IS_DIGIT_RE.test(segment) && segment.length < 3) {\n goodSegment = true;\n }\n\n // If this is the first url_segment and it's just \"index\",\n // remove it\n if (index === 0 && segment.toLowerCase() === 'index') {\n goodSegment = false;\n }\n\n // If our first or second url_segment is smaller than 3 characters,\n // and the first url_segment had no alphas, remove it.\n if (index < 2 && segment.length < 3 && !firstSegmentHasLetters) {\n goodSegment = false;\n }\n\n return goodSegment;\n}\n\n// Take a URL, and return the article base of said URL. That is, no\n// pagination data exists in it. Useful for comparing to other links\n// that might have pagination data within them.\nexport default function articleBaseUrl(url, parsed) {\n const parsedUrl = parsed || URL.parse(url);\n const { protocol, host, path } = parsedUrl;\n\n let firstSegmentHasLetters = false;\n const cleanedSegments = path.split('/')\n .reverse()\n .reduce((acc, rawSegment, index) => {\n let segment = rawSegment;\n\n // Split off and save anything that looks like a file type.\n if (segment.includes('.')) {\n const [possibleSegment, fileExt] = segment.split('.');\n if (IS_ALPHA_RE.test(fileExt)) {\n segment = possibleSegment;\n }\n }\n\n // If our first or second segment has anything looking like a page\n // number, remove it.\n if (PAGE_IN_HREF_RE.test(segment) && index < 2) {\n segment = segment.replace(PAGE_IN_HREF_RE, '');\n }\n\n // If we're on the first segment, check to see if we have any\n // characters in it. The first segment is actually the last bit of\n // the URL, and this will be helpful to determine if we're on a URL\n // segment that looks like \"/2/\" for example.\n if (index === 0) {\n firstSegmentHasLetters = HAS_ALPHA_RE.test(segment);\n }\n\n // If it's not marked for deletion, push it to cleaned_segments.\n if (isGoodSegment(segment, index, firstSegmentHasLetters)) {\n acc.push(segment);\n }\n\n return acc;\n }, []);\n\n return `${protocol}//${host}${cleanedSegments.reverse().join('/')}`;\n}\n","// Given a string, return True if it appears to have an ending sentence\n// within it, false otherwise.\nconst SENTENCE_END_RE = new RegExp('.( |$)');\nexport default function hasSentenceEnd(text) {\n return SENTENCE_END_RE.test(text);\n}\n","import {\n textLength,\n linkDensity,\n} from 'utils/dom';\nimport { hasSentenceEnd } from 'utils/text';\n\nimport { NON_TOP_CANDIDATE_TAGS_RE } from './constants';\nimport { getScore } from './index';\n\n// Now that we have a top_candidate, look through the siblings of\n// it to see if any of them are decently scored. If they are, they\n// may be split parts of the content (Like two divs, a preamble and\n// a body.) Example:\n// http://articles.latimes.com/2009/oct/14/business/fi-bigtvs14\nexport default function mergeSiblings($candidate, topScore, $) {\n if (!$candidate.parent().length) {\n return $candidate;\n }\n\n const siblingScoreThreshold = Math.max(10, topScore * 0.25);\n const wrappingDiv = $('<div></div>');\n\n $candidate.parent().children().each((index, sibling) => {\n const $sibling = $(sibling);\n // Ignore tags like BR, HR, etc\n if (NON_TOP_CANDIDATE_TAGS_RE.test(sibling.tagName)) {\n return null;\n }\n\n const siblingScore = getScore($sibling);\n if (siblingScore) {\n if ($sibling.get(0) === $candidate.get(0)) {\n wrappingDiv.append($sibling);\n } else {\n let contentBonus = 0;\n const density = linkDensity($sibling);\n\n // If sibling has a very low link density,\n // give it a small bonus\n if (density < 0.05) {\n contentBonus += 20;\n }\n\n // If sibling has a high link density,\n // give it a penalty\n if (density >= 0.5) {\n contentBonus -= 20;\n }\n\n // If sibling node has the same class as\n // candidate, give it a bonus\n if ($sibling.attr('class') === $candidate.attr('class')) {\n contentBonus += topScore * 0.2;\n }\n\n const newScore = siblingScore + contentBonus;\n\n if (newScore >= siblingScoreThreshold) {\n return wrappingDiv.append($sibling);\n } else if (sibling.tagName === 'p') {\n const siblingContent = $sibling.text();\n const siblingContentLength = textLength(siblingContent);\n\n if (siblingContentLength > 80 && density < 0.25) {\n return wrappingDiv.append($sibling);\n } else if (siblingContentLength <= 80 && density === 0 &&\n hasSentenceEnd(siblingContent)) {\n return wrappingDiv.append($sibling);\n }\n }\n }\n }\n\n return null;\n });\n\n if (wrappingDiv.children().length === 1 &&\n wrappingDiv.children().first().get(0) === $candidate.get(0)) {\n return $candidate;\n }\n\n return wrappingDiv;\n}\n","// Scoring\nexport { default as getWeight } from './get-weight';\nexport { default as getScore } from './get-score';\nexport { default as scoreCommas } from './score-commas';\nexport { default as scoreLength } from './score-length';\nexport { default as scoreParagraph } from './score-paragraph';\nexport { default as setScore } from './set-score';\nexport { default as addScore } from './add-score';\nexport { default as addToParent } from './add-to-parent';\nexport { default as getOrInitScore } from './get-or-init-score';\nexport { default as scoreNode } from './score-node';\nexport { default as scoreContent } from './score-content';\nexport { default as findTopCandidate } from './find-top-candidate';\n","import {\n getScore,\n setScore,\n getOrInitScore,\n scoreCommas,\n} from 'extractors/generic/content/scoring';\n\nimport {\n CLEAN_CONDITIONALLY_TAGS,\n KEEP_CLASS,\n} from './constants';\nimport { normalizeSpaces } from '../text';\nimport { linkDensity } from './index';\n\nfunction removeUnlessContent($node, $, weight) {\n // Explicitly save entry-content-asset tags, which are\n // noted as valuable in the Publisher guidelines. For now\n // this works everywhere. We may want to consider making\n // this less of a sure-thing later.\n if ($node.hasClass('entry-content-asset')) {\n return;\n }\n\n const content = normalizeSpaces($node.text());\n\n if (scoreCommas(content) < 10) {\n const pCount = $('p', $node).length;\n const inputCount = $('input', $node).length;\n\n // Looks like a form, too many inputs.\n if (inputCount > (pCount / 3)) {\n $node.remove();\n return;\n }\n\n const contentLength = content.length;\n const imgCount = $('img', $node).length;\n\n // Content is too short, and there are no images, so\n // this is probably junk content.\n if (contentLength < 25 && imgCount === 0) {\n $node.remove();\n return;\n }\n\n const density = linkDensity($node);\n\n // Too high of link density, is probably a menu or\n // something similar.\n // console.log(weight, density, contentLength)\n if (weight < 25 && density > 0.2 && contentLength > 75) {\n $node.remove();\n return;\n }\n\n // Too high of a link density, despite the score being\n // high.\n if (weight >= 25 && density > 0.5) {\n // Don't remove the node if it's a list and the\n // previous sibling starts with a colon though. That\n // means it's probably content.\n const tagName = $node.get(0).tagName.toLowerCase();\n const nodeIsList = tagName === 'ol' || tagName === 'ul';\n if (nodeIsList) {\n const previousNode = $node.prev();\n if (previousNode && normalizeSpaces(previousNode.text()).slice(-1) === ':') {\n return;\n }\n }\n\n $node.remove();\n return;\n }\n\n const scriptCount = $('script', $node).length;\n\n // Too many script tags, not enough content.\n if (scriptCount > 0 && contentLength < 150) {\n $node.remove();\n return;\n }\n }\n}\n\n// Given an article, clean it of some superfluous content specified by\n// tags. Things like forms, ads, etc.\n//\n// Tags is an array of tag name's to search through. (like div, form,\n// etc)\n//\n// Return this same doc.\nexport default function cleanTags($article, $) {\n $(CLEAN_CONDITIONALLY_TAGS, $article).each((index, node) => {\n const $node = $(node);\n // If marked to keep, skip it\n if ($node.hasClass(KEEP_CLASS) || $node.find(`.${KEEP_CLASS}`).length > 0) return;\n\n let weight = getScore($node);\n if (!weight) {\n weight = getOrInitScore($node, $);\n setScore($node, $, weight);\n }\n\n // drop node if its weight is < 0\n if (weight < 0) {\n $node.remove();\n } else {\n // deteremine if node seems like content\n removeUnlessContent($node, $, weight);\n }\n });\n\n return $;\n}\n","import URL from 'url';\n\nimport {\n getAttrs,\n setAttr,\n} from 'utils/dom';\n\nfunction absolutize($, rootUrl, attr, $content) {\n $(`[${attr}]`, $content).each((_, node) => {\n const attrs = getAttrs(node);\n const url = attrs[attr];\n\n if (url) {\n const absoluteUrl = URL.resolve(rootUrl, url);\n setAttr(node, attr, absoluteUrl);\n }\n });\n}\n\nexport default function makeLinksAbsolute($content, $, url) {\n ['href', 'src'].forEach(attr => absolutize($, url, attr, $content));\n\n return $content;\n}\n","export function textLength(text) {\n return text.trim()\n .replace(/\\s+/g, ' ')\n .length;\n}\n\n// Determines what percentage of the text\n// in a node is link text\n// Takes a node, returns a float\nexport function linkDensity($node) {\n const totalTextLength = textLength($node.text());\n\n const linkText = $node.find('a').text();\n const linkLength = textLength(linkText);\n\n if (totalTextLength > 0) {\n return linkLength / totalTextLength;\n } else if (totalTextLength === 0 && linkLength > 0) {\n return 1;\n }\n\n return 0;\n}\n","import { withinComment } from 'utils/dom';\n\nfunction isGoodNode($node, maxChildren) {\n // If it has a number of children, it's more likely a container\n // element. Skip it.\n if ($node.children().length > maxChildren) {\n return false;\n }\n // If it looks to be within a comment, skip it.\n if (withinComment($node)) {\n return false;\n }\n\n return true;\n}\n\n// Given a a list of selectors find content that may\n// be extractable from the document. This is for flat\n// meta-information, like author, title, date published, etc.\nexport default function extractFromSelectors(\n $,\n selectors,\n maxChildren = 1,\n textOnly = true\n) {\n for (const selector of selectors) {\n const nodes = $(selector);\n\n // If we didn't get exactly one of this selector, this may be\n // a list of articles or comments. Skip it.\n if (nodes.length === 1) {\n const $node = $(nodes[0]);\n\n if (isGoodNode($node, maxChildren)) {\n let content;\n if (textOnly) {\n content = $node.text();\n } else {\n content = $node.html();\n }\n\n if (content) {\n return content;\n }\n }\n }\n }\n\n return null;\n}\n","// strips all tags from a string of text\nexport default function stripTags(text, $) {\n // Wrapping text in html element prevents errors when text\n // has no html\n const cleanText = $(`<span>${text}</span>`).text();\n return cleanText === '' ? text : cleanText;\n}\n","import { getAttrs } from 'utils/dom';\n\nexport default function withinComment($node) {\n const parents = $node.parents().toArray();\n const commentParent = parents.find((parent) => {\n const attrs = getAttrs(parent);\n const { class: nodeClass, id } = attrs;\n const classAndId = `${nodeClass} ${id}`;\n return classAndId.includes('comment');\n });\n\n return commentParent !== undefined;\n}\n","// Given a node, determine if it's article-like enough to return\n// param: node (a cheerio node)\n// return: boolean\n\nexport default function nodeIsSufficient($node) {\n return $node.text().trim().length >= 100;\n}\n","export default function getAttrs(node) {\n const { attribs, attributes } = node;\n\n if (!attribs && attributes) {\n const attrs = Reflect.ownKeys(attributes).reduce((acc, index) => {\n const attr = attributes[index];\n\n if (!attr.name || !attr.value) return acc;\n\n acc[attr.name] = attr.value;\n return acc;\n }, {});\n return attrs;\n }\n\n return attribs;\n}\n","export default function setAttr(node, attr, val) {\n if (node.attribs) {\n node.attribs[attr] = val;\n } else if (node.attributes) {\n node.setAttribute(attr, val);\n }\n\n return node;\n}\n","export default function setAttrs(node, attrs) {\n if (node.attribs) {\n node.attribs = attrs;\n } else if (node.attributes) {\n while (node.attributes.length > 0) {\n node.removeAttribute(node.attributes[0].name);\n }\n\n Reflect.ownKeys(attrs).forEach((key) => {\n node.setAttribute(key, attrs[key]);\n });\n }\n\n return node;\n}\n","// DOM manipulation\nexport { default as stripUnlikelyCandidates } from './strip-unlikely-candidates';\nexport { default as brsToPs } from './brs-to-ps';\nexport { default as paragraphize } from './paragraphize';\nexport { default as convertToParagraphs } from './convert-to-paragraphs';\nexport { default as convertNodeTo } from './convert-node-to';\nexport { default as cleanImages } from './clean-images';\nexport { default as markToKeep } from './mark-to-keep';\nexport { default as stripJunkTags } from './strip-junk-tags';\nexport { default as cleanHOnes } from './clean-h-ones';\nexport { default as cleanAttributes } from './clean-attributes';\nexport { default as removeEmpty } from './remove-empty';\nexport { default as cleanTags } from './clean-tags';\nexport { default as cleanHeaders } from './clean-headers';\nexport { default as rewriteTopLevel } from './rewrite-top-level';\nexport { default as makeLinksAbsolute } from './make-links-absolute';\nexport { textLength, linkDensity } from './link-density';\nexport { default as extractFromMeta } from './extract-from-meta';\nexport { default as extractFromSelectors } from './extract-from-selectors';\nexport { default as stripTags } from './strip-tags';\nexport { default as withinComment } from './within-comment';\nexport { default as nodeIsSufficient } from './node-is-sufficient';\nexport { default as isWordpress } from './is-wordpress';\nexport { default as getAttrs } from './get-attrs';\nexport { default as setAttr } from './set-attr';\nexport { default as setAttrs } from './set-attrs';\n","'use strict';\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar _regeneratorRuntime = _interopDefault(require('babel-runtime/regenerator'));\nvar _extends = _interopDefault(require('babel-runtime/helpers/extends'));\nvar _asyncToGenerator = _interopDefault(require('babel-runtime/helpers/asyncToGenerator'));\nvar URL = _interopDefault(require('url'));\nvar cheerio = _interopDefault(require('cheerio'));\nvar iconv = _interopDefault(require('iconv-lite'));\nvar _slicedToArray = _interopDefault(require('babel-runtime/helpers/slicedToArray'));\nvar _Promise = _interopDefault(require('babel-runtime/core-js/promise'));\nvar request = _interopDefault(require('request'));\nvar _Reflect$ownKeys = _interopDefault(require('babel-runtime/core-js/reflect/own-keys'));\nvar _toConsumableArray = _interopDefault(require('babel-runtime/helpers/toConsumableArray'));\nvar _defineProperty = _interopDefault(require('babel-runtime/helpers/defineProperty'));\nvar _typeof = _interopDefault(require('babel-runtime/helpers/typeof'));\nvar _getIterator = _interopDefault(require('babel-runtime/core-js/get-iterator'));\nvar _Object$keys = _interopDefault(require('babel-runtime/core-js/object/keys'));\nvar stringDirection = _interopDefault(require('string-direction'));\nvar validUrl = _interopDefault(require('valid-url'));\nvar moment = _interopDefault(require('moment-timezone'));\nvar parseFormat = _interopDefault(require('moment-parseformat'));\nvar wuzzy = _interopDefault(require('wuzzy'));\nvar difflib = _interopDefault(require('difflib'));\nvar _Array$from = _interopDefault(require('babel-runtime/core-js/array/from'));\nvar ellipsize = _interopDefault(require('ellipsize'));\n\nvar NORMALIZE_RE = /\\s{2,}/g;\n\nfunction normalizeSpaces(text) {\n return text.replace(NORMALIZE_RE, ' ').trim();\n}\n\n// Given a node type to search for, and a list of regular expressions,\n// look to see if this extraction can be found in the URL. Expects\n// that each expression in r_list will return group(1) as the proper\n// string to be cleaned.\n// Only used for date_published currently.\nfunction extractFromUrl(url, regexList) {\n var matchRe = regexList.find(function (re) {\n return re.test(url);\n });\n if (matchRe) {\n return matchRe.exec(url)[1];\n }\n\n return null;\n}\n\n// An expression that looks to try to find the page digit within a URL, if\n// it exists.\n// Matches:\n// page=1\n// pg=1\n// p=1\n// paging=12\n// pag=7\n// pagination/1\n// paging/88\n// pa/83\n// p/11\n//\n// Does not match:\n// pg=102\n// page:2\nvar PAGE_IN_HREF_RE = new RegExp('(page|paging|(p(a|g|ag)?(e|enum|ewanted|ing|ination)))?(=|/)([0-9]{1,3})', 'i');\n\nvar HAS_ALPHA_RE = /[a-z]/i;\n\nvar IS_ALPHA_RE = /^[a-z]+$/i;\nvar IS_DIGIT_RE = /^[0-9]+$/i;\n\nvar ENCODING_RE = /charset=([\\w-]+)\\b/;\nvar DEFAULT_ENCODING = 'utf-8';\n\nfunction pageNumFromUrl(url) {\n var matches = url.match(PAGE_IN_HREF_RE);\n if (!matches) return null;\n\n var pageNum = parseInt(matches[6], 10);\n\n // Return pageNum < 100, otherwise\n // return null\n return pageNum < 100 ? pageNum : null;\n}\n\nfunction removeAnchor(url) {\n return url.split('#')[0].replace(/\\/$/, '');\n}\n\nfunction isGoodSegment(segment, index, firstSegmentHasLetters) {\n var goodSegment = true;\n\n // If this is purely a number, and it's the first or second\n // url_segment, it's probably a page number. Remove it.\n if (index < 2 && IS_DIGIT_RE.test(segment) && segment.length < 3) {\n goodSegment = true;\n }\n\n // If this is the first url_segment and it's just \"index\",\n // remove it\n if (index === 0 && segment.toLowerCase() === 'index') {\n goodSegment = false;\n }\n\n // If our first or second url_segment is smaller than 3 characters,\n // and the first url_segment had no alphas, remove it.\n if (index < 2 && segment.length < 3 && !firstSegmentHasLetters) {\n goodSegment = false;\n }\n\n return goodSegment;\n}\n\n// Take a URL, and return the article base of said URL. That is, no\n// pagination data exists in it. Useful for comparing to other links\n// that might have pagination data within them.\nfunction articleBaseUrl(url, parsed) {\n var parsedUrl = parsed || URL.parse(url);\n var protocol = parsedUrl.protocol,\n host = parsedUrl.host,\n path = parsedUrl.path;\n\n\n var firstSegmentHasLetters = false;\n var cleanedSegments = path.split('/').reverse().reduce(function (acc, rawSegment, index) {\n var segment = rawSegment;\n\n // Split off and save anything that looks like a file type.\n if (segment.includes('.')) {\n var _segment$split = segment.split('.'),\n _segment$split2 = _slicedToArray(_segment$split, 2),\n possibleSegment = _segment$split2[0],\n fileExt = _segment$split2[1];\n\n if (IS_ALPHA_RE.test(fileExt)) {\n segment = possibleSegment;\n }\n }\n\n // If our first or second segment has anything looking like a page\n // number, remove it.\n if (PAGE_IN_HREF_RE.test(segment) && index < 2) {\n segment = segment.replace(PAGE_IN_HREF_RE, '');\n }\n\n // If we're on the first segment, check to see if we have any\n // characters in it. The first segment is actually the last bit of\n // the URL, and this will be helpful to determine if we're on a URL\n // segment that looks like \"/2/\" for example.\n if (index === 0) {\n firstSegmentHasLetters = HAS_ALPHA_RE.test(segment);\n }\n\n // If it's not marked for deletion, push it to cleaned_segments.\n if (isGoodSegment(segment, index, firstSegmentHasLetters)) {\n acc.push(segment);\n }\n\n return acc;\n }, []);\n\n return protocol + '//' + host + cleanedSegments.reverse().join('/');\n}\n\n// Given a string, return True if it appears to have an ending sentence\n// within it, false otherwise.\nvar SENTENCE_END_RE = new RegExp('.( |$)');\nfunction hasSentenceEnd(text) {\n return SENTENCE_END_RE.test(text);\n}\n\nfunction excerptContent(content) {\n var words = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;\n\n return content.trim().split(/\\s+/).slice(0, words).join(' ');\n}\n\n// check a string for encoding; this is\n// used in our fetchResource function to\n// ensure correctly encoded responses\nfunction getEncoding(str) {\n var encoding = DEFAULT_ENCODING;\n if (ENCODING_RE.test(str)) {\n var testEncode = ENCODING_RE.exec(str)[1];\n if (iconv.encodingExists(testEncode)) {\n encoding = testEncode;\n }\n }\n return encoding;\n}\n\nvar _marked = [range].map(_regeneratorRuntime.mark);\n\nfunction range() {\n var start = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;\n var end = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n return _regeneratorRuntime.wrap(function range$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (!(start <= end)) {\n _context.next = 5;\n break;\n }\n\n _context.next = 3;\n return start += 1;\n\n case 3:\n _context.next = 0;\n break;\n\n case 5:\n case \"end\":\n return _context.stop();\n }\n }\n }, _marked[0], this);\n}\n\n// extremely simple url validation as a first step\nfunction validateUrl(_ref) {\n var hostname = _ref.hostname;\n\n // If this isn't a valid url, return an error message\n return !!hostname;\n}\n\nvar Errors = {\n badUrl: {\n error: true,\n messages: 'The url parameter passed does not look like a valid URL. Please check your data and try again.'\n }\n};\n\n// Browser does not like us setting user agent\nvar REQUEST_HEADERS = cheerio.browser ? {} : {\n 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36'\n};\n\n// The number of milliseconds to attempt to fetch a resource before timing out.\nvar FETCH_TIMEOUT = 10000;\n\n// Content types that we do not extract content from\nvar BAD_CONTENT_TYPES = ['audio/mpeg', 'image/gif', 'image/jpeg', 'image/jpg'];\n\nvar BAD_CONTENT_TYPES_RE = new RegExp('^(' + BAD_CONTENT_TYPES.join('|') + ')$', 'i');\n\n// Use this setting as the maximum size an article can be\n// for us to attempt parsing. Defaults to 5 MB.\nvar MAX_CONTENT_LENGTH = 5242880;\n\n// Turn the global proxy on or off\n// Proxying is not currently enabled in Python source\n// so not implementing logic in port.\n\nfunction get(options) {\n return new _Promise(function (resolve, reject) {\n request(options, function (err, response, body) {\n if (err) {\n reject(err);\n } else {\n resolve({ body: body, response: response });\n }\n });\n });\n}\n\n// Evaluate a response to ensure it's something we should be keeping.\n// This does not validate in the sense of a response being 200 level or\n// not. Validation here means that we haven't found reason to bail from\n// further processing of this url.\n\nfunction validateResponse(response) {\n var parseNon2xx = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n // Check if we got a valid status code\n // This isn't great, but I'm requiring a statusMessage to be set\n // before short circuiting b/c nock doesn't set it in tests\n // statusMessage only not set in nock response, in which case\n // I check statusCode, which is currently only 200 for OK responses\n // in tests\n if (response.statusMessage && response.statusMessage !== 'OK' || response.statusCode !== 200) {\n if (!response.statusCode) {\n throw new Error('Unable to fetch content. Original exception was ' + response.error);\n } else if (!parseNon2xx) {\n throw new Error('Resource returned a response status code of ' + response.statusCode + ' and resource was instructed to reject non-2xx level status codes.');\n }\n }\n\n var _response$headers = response.headers,\n contentType = _response$headers['content-type'],\n contentLength = _response$headers['content-length'];\n\n // Check that the content is not in BAD_CONTENT_TYPES\n\n if (BAD_CONTENT_TYPES_RE.test(contentType)) {\n throw new Error('Content-type for this resource was ' + contentType + ' and is not allowed.');\n }\n\n // Check that the content length is below maximum\n if (contentLength > MAX_CONTENT_LENGTH) {\n throw new Error('Content for this resource was too large. Maximum content length is ' + MAX_CONTENT_LENGTH + '.');\n }\n\n return true;\n}\n\n// Grabs the last two pieces of the URL and joins them back together\n// This is to get the 'livejournal.com' from 'erotictrains.livejournal.com'\n\n\n// Set our response attribute to the result of fetching our URL.\n// TODO: This should gracefully handle timeouts and raise the\n// proper exceptions on the many failure cases of HTTP.\n// TODO: Ensure we are not fetching something enormous. Always return\n// unicode content for HTML, with charset conversion.\n\nvar fetchResource$1 = (function () {\n var _ref2 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee(url, parsedUrl) {\n var options, _ref3, response, body;\n\n return _regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n parsedUrl = parsedUrl || URL.parse(encodeURI(url));\n\n options = {\n url: parsedUrl.href,\n headers: _extends({}, REQUEST_HEADERS),\n timeout: FETCH_TIMEOUT,\n // Accept cookies\n jar: true,\n // Set to null so the response returns as binary and body as buffer\n // https://github.com/request/request#requestoptions-callback\n encoding: null,\n // Accept and decode gzip\n gzip: true,\n // Follow any redirect\n followAllRedirects: true\n };\n _context.next = 4;\n return get(options);\n\n case 4:\n _ref3 = _context.sent;\n response = _ref3.response;\n body = _ref3.body;\n _context.prev = 7;\n\n validateResponse(response);\n return _context.abrupt('return', {\n body: body,\n response: response\n });\n\n case 12:\n _context.prev = 12;\n _context.t0 = _context['catch'](7);\n return _context.abrupt('return', Errors.badUrl);\n\n case 15:\n case 'end':\n return _context.stop();\n }\n }\n }, _callee, this, [[7, 12]]);\n }));\n\n function fetchResource(_x2, _x3) {\n return _ref2.apply(this, arguments);\n }\n\n return fetchResource;\n})();\n\nfunction convertMetaProp($, from, to) {\n $('meta[' + from + ']').each(function (_, node) {\n var $node = $(node);\n\n var value = $node.attr(from);\n $node.attr(to, value);\n $node.removeAttr(from);\n });\n\n return $;\n}\n\n// For ease of use in extracting from meta tags,\n// replace the \"content\" attribute on meta tags with the\n// \"value\" attribute.\n//\n// In addition, normalize 'property' attributes to 'name' for ease of\n// querying later. See, e.g., og or twitter meta tags.\n\nfunction normalizeMetaTags($) {\n $ = convertMetaProp($, 'content', 'value');\n $ = convertMetaProp($, 'property', 'name');\n return $;\n}\n\n// Spacer images to be removed\nvar SPACER_RE = new RegExp('transparent|spacer|blank', 'i');\n\n// The class we will use to mark elements we want to keep\n// but would normally remove\nvar KEEP_CLASS = 'mercury-parser-keep';\n\nvar KEEP_SELECTORS = ['iframe[src^=\"https://www.youtube.com\"]', 'iframe[src^=\"https://www.youtube-nocookie.com\"]', 'iframe[src^=\"http://www.youtube.com\"]', 'iframe[src^=\"https://player.vimeo\"]', 'iframe[src^=\"http://player.vimeo\"]'];\n\n// A list of tags to strip from the output if we encounter them.\nvar STRIP_OUTPUT_TAGS = ['title', 'script', 'noscript', 'link', 'style', 'hr', 'embed', 'iframe', 'object'];\n\n// cleanAttributes\nvar REMOVE_ATTRS = ['style', 'align'];\nvar REMOVE_ATTR_SELECTORS = REMOVE_ATTRS.map(function (selector) {\n return '[' + selector + ']';\n});\nvar REMOVE_ATTR_LIST = REMOVE_ATTRS.join(',');\nvar WHITELIST_ATTRS = ['src', 'srcset', 'href', 'class', 'id', 'alt', 'xlink:href', 'width', 'height'];\n\nvar WHITELIST_ATTRS_RE = new RegExp('^(' + WHITELIST_ATTRS.join('|') + ')$', 'i');\n\n// removeEmpty\nvar REMOVE_EMPTY_TAGS = ['p'];\nvar REMOVE_EMPTY_SELECTORS = REMOVE_EMPTY_TAGS.map(function (tag) {\n return tag + ':empty';\n}).join(',');\n\n// cleanTags\nvar CLEAN_CONDITIONALLY_TAGS = ['ul', 'ol', 'table', 'div', 'button', 'form'].join(',');\n\n// cleanHeaders\nvar HEADER_TAGS = ['h2', 'h3', 'h4', 'h5', 'h6'];\nvar HEADER_TAG_LIST = HEADER_TAGS.join(',');\n\n// // CONTENT FETCHING CONSTANTS ////\n\n// A list of strings that can be considered unlikely candidates when\n// extracting content from a resource. These strings are joined together\n// and then tested for existence using re:test, so may contain simple,\n// non-pipe style regular expression queries if necessary.\nvar UNLIKELY_CANDIDATES_BLACKLIST = ['ad-break', 'adbox', 'advert', 'addthis', 'agegate', 'aux', 'blogger-labels', 'combx', 'comment', 'conversation', 'disqus', 'entry-unrelated', 'extra', 'foot',\n// 'form', // This is too generic, has too many false positives\n'header', 'hidden', 'loader', 'login', // Note: This can hit 'blogindex'.\n'menu', 'meta', 'nav', 'outbrain', 'pager', 'pagination', 'predicta', // readwriteweb inline ad box\n'presence_control_external', // lifehacker.com container full of false positives\n'popup', 'printfriendly', 'related', 'remove', 'remark', 'rss', 'share', 'shoutbox', 'sidebar', 'sociable', 'sponsor', 'taboola', 'tools'];\n\n// A list of strings that can be considered LIKELY candidates when\n// extracting content from a resource. Essentially, the inverse of the\n// blacklist above - if something matches both blacklist and whitelist,\n// it is kept. This is useful, for example, if something has a className\n// of \"rss-content entry-content\". It matched 'rss', so it would normally\n// be removed, however, it's also the entry content, so it should be left\n// alone.\n//\n// These strings are joined together and then tested for existence using\n// re:test, so may contain simple, non-pipe style regular expression queries\n// if necessary.\nvar UNLIKELY_CANDIDATES_WHITELIST = ['and', 'article', 'body', 'blogindex', 'column', 'content', 'entry-content-asset', 'format', // misuse of form\n'hfeed', 'hentry', 'hatom', 'main', 'page', 'posts', 'shadow'];\n\n// A list of tags which, if found inside, should cause a <div /> to NOT\n// be turned into a paragraph tag. Shallow div tags without these elements\n// should be turned into <p /> tags.\nvar DIV_TO_P_BLOCK_TAGS = ['a', 'blockquote', 'dl', 'div', 'img', 'p', 'pre', 'table'].join(',');\n\n// A list of tags that should be ignored when trying to find the top candidate\n// for a document.\n\n\n\n\n// A list of selectors that specify, very clearly, either hNews or other\n// very content-specific style content, like Blogger templates.\n// More examples here: http://microformats.org/wiki/blog-post-formats\n\n\n\n\n\n// A list of strings that denote a positive scoring for this content as being\n// an article container. Checked against className and id.\n//\n// TODO: Perhaps have these scale based on their odds of being quality?\nvar POSITIVE_SCORE_HINTS = ['article', 'articlecontent', 'instapaper_body', 'blog', 'body', 'content', 'entry-content-asset', 'entry', 'hentry', 'main', 'Normal', 'page', 'pagination', 'permalink', 'post', 'story', 'text', '[-_]copy', // usatoday\n'\\\\Bcopy'];\n\n// The above list, joined into a matching regular expression\nvar POSITIVE_SCORE_RE = new RegExp(POSITIVE_SCORE_HINTS.join('|'), 'i');\n\n// Readability publisher-specific guidelines\n\n\n// A list of strings that denote a negative scoring for this content as being\n// an article container. Checked against className and id.\n//\n// TODO: Perhaps have these scale based on their odds of being quality?\nvar NEGATIVE_SCORE_HINTS = ['adbox', 'advert', 'author', 'bio', 'bookmark', 'bottom', 'byline', 'clear', 'com-', 'combx', 'comment', 'comment\\\\B', 'contact', 'copy', 'credit', 'crumb', 'date', 'deck', 'excerpt', 'featured', // tnr.com has a featured_content which throws us off\n'foot', 'footer', 'footnote', 'graf', 'head', 'info', 'infotext', // newscientist.com copyright\n'instapaper_ignore', 'jump', 'linebreak', 'link', 'masthead', 'media', 'meta', 'modal', 'outbrain', // slate.com junk\n'promo', 'pr_', // autoblog - press release\n'related', 'respond', 'roundcontent', // lifehacker restricted content warning\n'scroll', 'secondary', 'share', 'shopping', 'shoutbox', 'side', 'sidebar', 'sponsor', 'stamp', 'sub', 'summary', 'tags', 'tools', 'widget'];\n// The above list, joined into a matching regular expression\nvar NEGATIVE_SCORE_RE = new RegExp(NEGATIVE_SCORE_HINTS.join('|'), 'i');\n\n// XPath to try to determine if a page is wordpress. Not always successful.\nvar IS_WP_SELECTOR = 'meta[name=generator][value^=WordPress]';\n\n// Match a digit. Pretty clear.\n\n\n// A list of words that, if found in link text or URLs, likely mean that\n// this link is not a next page link.\n\n\n\n// Match any phrase that looks like it could be page, or paging, or pagination\nvar PAGE_RE = new RegExp('pag(e|ing|inat)', 'i');\n\n// Match any link text/classname/id that looks like it could mean the next\n// page. Things like: next, continue, >, >>, » but not >|, »| as those can\n// mean last page.\n// export const NEXT_LINK_TEXT_RE = new RegExp('(next|weiter|continue|>([^\\|]|$)|»([^\\|]|$))', 'i');\n\n\n// Match any link text/classname/id that looks like it is an end link: things\n// like \"first\", \"last\", \"end\", etc.\n\n\n// Match any link text/classname/id that looks like it means the previous\n// page.\n\n\n// Match 2 or more consecutive <br> tags\n\n\n// Match 1 BR tag.\n\n\n// A list of all of the block level tags known in HTML5 and below. Taken from\n// http://bit.ly/qneNIT\nvar BLOCK_LEVEL_TAGS = ['article', 'aside', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'col', 'colgroup', 'dd', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hgroup', 'hr', 'li', 'map', 'object', 'ol', 'output', 'p', 'pre', 'progress', 'section', 'table', 'tbody', 'textarea', 'tfoot', 'th', 'thead', 'tr', 'ul', 'video'];\nvar BLOCK_LEVEL_TAGS_RE = new RegExp('^(' + BLOCK_LEVEL_TAGS.join('|') + ')$', 'i');\n\n// The removal is implemented as a blacklist and whitelist, this test finds\n// blacklisted elements that aren't whitelisted. We do this all in one\n// expression-both because it's only one pass, and because this skips the\n// serialization for whitelisted nodes.\nvar candidatesBlacklist = UNLIKELY_CANDIDATES_BLACKLIST.join('|');\nvar CANDIDATES_BLACKLIST = new RegExp(candidatesBlacklist, 'i');\n\nvar candidatesWhitelist = UNLIKELY_CANDIDATES_WHITELIST.join('|');\nvar CANDIDATES_WHITELIST = new RegExp(candidatesWhitelist, 'i');\n\nfunction stripUnlikelyCandidates($) {\n // Loop through the provided document and remove any non-link nodes\n // that are unlikely candidates for article content.\n //\n // Links are ignored because there are very often links to content\n // that are identified as non-body-content, but may be inside\n // article-like content.\n //\n // :param $: a cheerio object to strip nodes from\n // :return $: the cleaned cheerio object\n $('*').not('a').each(function (index, node) {\n var $node = $(node);\n var classes = $node.attr('class');\n var id = $node.attr('id');\n if (!id && !classes) return;\n\n var classAndId = (classes || '') + ' ' + (id || '');\n if (CANDIDATES_WHITELIST.test(classAndId)) {\n return;\n } else if (CANDIDATES_BLACKLIST.test(classAndId)) {\n $node.remove();\n }\n });\n\n return $;\n}\n\n// ## NOTES:\n// Another good candidate for refactoring/optimizing.\n// Very imperative code, I don't love it. - AP\n\n// Given cheerio object, convert consecutive <br /> tags into\n// <p /> tags instead.\n//\n// :param $: A cheerio object\n\nfunction brsToPs$$1($) {\n var collapsing = false;\n $('br').each(function (index, element) {\n var $element = $(element);\n var nextElement = $element.next().get(0);\n\n if (nextElement && nextElement.tagName.toLowerCase() === 'br') {\n collapsing = true;\n $element.remove();\n } else if (collapsing) {\n collapsing = false;\n // $(element).replaceWith('<p />')\n paragraphize(element, $, true);\n }\n });\n\n return $;\n}\n\n// Given a node, turn it into a P if it is not already a P, and\n// make sure it conforms to the constraints of a P tag (I.E. does\n// not contain any other block tags.)\n//\n// If the node is a <br />, it treats the following inline siblings\n// as if they were its children.\n//\n// :param node: The node to paragraphize; this is a raw node\n// :param $: The cheerio object to handle dom manipulation\n// :param br: Whether or not the passed node is a br\n\nfunction paragraphize(node, $) {\n var br = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n var $node = $(node);\n\n if (br) {\n var sibling = node.nextSibling;\n var p = $('<p></p>');\n\n // while the next node is text or not a block level element\n // append it to a new p node\n while (sibling && !(sibling.tagName && BLOCK_LEVEL_TAGS_RE.test(sibling.tagName))) {\n var nextSibling = sibling.nextSibling;\n $(sibling).appendTo(p);\n sibling = nextSibling;\n }\n\n $node.replaceWith(p);\n $node.remove();\n return $;\n }\n\n return $;\n}\n\nfunction convertDivs($) {\n $('div').each(function (index, div) {\n var $div = $(div);\n var convertable = $div.children(DIV_TO_P_BLOCK_TAGS).length === 0;\n\n if (convertable) {\n convertNodeTo$$1($div, $, 'p');\n }\n });\n\n return $;\n}\n\nfunction convertSpans($) {\n $('span').each(function (index, span) {\n var $span = $(span);\n var convertable = $span.parents('p, div').length === 0;\n if (convertable) {\n convertNodeTo$$1($span, $, 'p');\n }\n });\n\n return $;\n}\n\n// Loop through the provided doc, and convert any p-like elements to\n// actual paragraph tags.\n//\n// Things fitting this criteria:\n// * Multiple consecutive <br /> tags.\n// * <div /> tags without block level elements inside of them\n// * <span /> tags who are not children of <p /> or <div /> tags.\n//\n// :param $: A cheerio object to search\n// :return cheerio object with new p elements\n// (By-reference mutation, though. Returned just for convenience.)\n\nfunction convertToParagraphs$$1($) {\n $ = brsToPs$$1($);\n $ = convertDivs($);\n $ = convertSpans($);\n\n return $;\n}\n\nfunction convertNodeTo$$1($node, $) {\n var tag = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'p';\n\n var node = $node.get(0);\n if (!node) {\n return $;\n }\n var attrs = getAttrs(node) || {};\n // console.log(attrs)\n\n var attribString = _Reflect$ownKeys(attrs).map(function (key) {\n return key + '=' + attrs[key];\n }).join(' ');\n var html = void 0;\n\n if ($.browser) {\n // In the browser, the contents of noscript tags aren't rendered, therefore\n // transforms on the noscript tag (commonly used for lazy-loading) don't work\n // as expected. This test case handles that\n html = node.tagName.toLowerCase() === 'noscript' ? $node.text() : $node.html();\n } else {\n html = $node.contents();\n }\n $node.replaceWith('<' + tag + ' ' + attribString + '>' + html + '</' + tag + '>');\n return $;\n}\n\nfunction cleanForHeight($img, $) {\n var height = parseInt($img.attr('height'), 10);\n var width = parseInt($img.attr('width'), 10) || 20;\n\n // Remove images that explicitly have very small heights or\n // widths, because they are most likely shims or icons,\n // which aren't very useful for reading.\n if ((height || 20) < 10 || width < 10) {\n $img.remove();\n } else if (height) {\n // Don't ever specify a height on images, so that we can\n // scale with respect to width without screwing up the\n // aspect ratio.\n $img.removeAttr('height');\n }\n\n return $;\n}\n\n// Cleans out images where the source string matches transparent/spacer/etc\n// TODO This seems very aggressive - AP\nfunction removeSpacers($img, $) {\n if (SPACER_RE.test($img.attr('src'))) {\n $img.remove();\n }\n\n return $;\n}\n\nfunction cleanImages($article, $) {\n $article.find('img').each(function (index, img) {\n var $img = $(img);\n\n cleanForHeight($img, $);\n removeSpacers($img, $);\n });\n\n return $;\n}\n\nfunction markToKeep(article, $, url) {\n var tags = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];\n\n if (tags.length === 0) {\n tags = KEEP_SELECTORS;\n }\n\n if (url) {\n var _URL$parse = URL.parse(url),\n protocol = _URL$parse.protocol,\n hostname = _URL$parse.hostname;\n\n tags = [].concat(_toConsumableArray(tags), ['iframe[src^=\"' + protocol + '//' + hostname + '\"]']);\n }\n\n $(tags.join(','), article).addClass(KEEP_CLASS);\n\n return $;\n}\n\nfunction stripJunkTags(article, $) {\n var tags = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];\n\n if (tags.length === 0) {\n tags = STRIP_OUTPUT_TAGS;\n }\n\n // Remove matching elements, but ignore\n // any element with a class of mercury-parser-keep\n $(tags.join(','), article).not('.' + KEEP_CLASS).remove();\n\n return $;\n}\n\n// H1 tags are typically the article title, which should be extracted\n// by the title extractor instead. If there's less than 3 of them (<3),\n// strip them. Otherwise, turn 'em into H2s.\nfunction cleanHOnes$$1(article, $) {\n var $hOnes = $('h1', article);\n\n if ($hOnes.length < 3) {\n $hOnes.each(function (index, node) {\n return $(node).remove();\n });\n } else {\n $hOnes.each(function (index, node) {\n convertNodeTo$$1($(node), $, 'h2');\n });\n }\n\n return $;\n}\n\nfunction removeAllButWhitelist($article, $) {\n $article.find('*').each(function (index, node) {\n var attrs = getAttrs(node);\n\n setAttrs(node, _Reflect$ownKeys(attrs).reduce(function (acc, attr) {\n if (WHITELIST_ATTRS_RE.test(attr)) {\n return _extends({}, acc, _defineProperty({}, attr, attrs[attr]));\n }\n\n return acc;\n }, {}));\n });\n\n // Remove the mercury-parser-keep class from result\n $('.' + KEEP_CLASS, $article).removeClass(KEEP_CLASS);\n\n return $article;\n}\n\n// function removeAttrs(article, $) {\n// REMOVE_ATTRS.forEach((attr) => {\n// $(`[${attr}]`, article).removeAttr(attr);\n// });\n// }\n\n// Remove attributes like style or align\nfunction cleanAttributes$$1($article, $) {\n // Grabbing the parent because at this point\n // $article will be wrapped in a div which will\n // have a score set on it.\n return removeAllButWhitelist($article.parent().length ? $article.parent() : $article, $);\n}\n\nfunction removeEmpty($article, $) {\n $article.find('p').each(function (index, p) {\n var $p = $(p);\n if ($p.find('iframe, img').length === 0 && $p.text().trim() === '') $p.remove();\n });\n\n return $;\n}\n\n// // CONTENT FETCHING CONSTANTS ////\n\n// A list of strings that can be considered unlikely candidates when\n// extracting content from a resource. These strings are joined together\n// and then tested for existence using re:test, so may contain simple,\n// non-pipe style regular expression queries if necessary.\nvar UNLIKELY_CANDIDATES_BLACKLIST$1 = ['ad-break', 'adbox', 'advert', 'addthis', 'agegate', 'aux', 'blogger-labels', 'combx', 'comment', 'conversation', 'disqus', 'entry-unrelated', 'extra', 'foot', 'form', 'header', 'hidden', 'loader', 'login', // Note: This can hit 'blogindex'.\n'menu', 'meta', 'nav', 'pager', 'pagination', 'predicta', // readwriteweb inline ad box\n'presence_control_external', // lifehacker.com container full of false positives\n'popup', 'printfriendly', 'related', 'remove', 'remark', 'rss', 'share', 'shoutbox', 'sidebar', 'sociable', 'sponsor', 'tools'];\n\n// A list of strings that can be considered LIKELY candidates when\n// extracting content from a resource. Essentially, the inverse of the\n// blacklist above - if something matches both blacklist and whitelist,\n// it is kept. This is useful, for example, if something has a className\n// of \"rss-content entry-content\". It matched 'rss', so it would normally\n// be removed, however, it's also the entry content, so it should be left\n// alone.\n//\n// These strings are joined together and then tested for existence using\n// re:test, so may contain simple, non-pipe style regular expression queries\n// if necessary.\nvar UNLIKELY_CANDIDATES_WHITELIST$1 = ['and', 'article', 'body', 'blogindex', 'column', 'content', 'entry-content-asset', 'format', // misuse of form\n'hfeed', 'hentry', 'hatom', 'main', 'page', 'posts', 'shadow'];\n\n// A list of tags which, if found inside, should cause a <div /> to NOT\n// be turned into a paragraph tag. Shallow div tags without these elements\n// should be turned into <p /> tags.\nvar DIV_TO_P_BLOCK_TAGS$1 = ['a', 'blockquote', 'dl', 'div', 'img', 'p', 'pre', 'table'].join(',');\n\n// A list of tags that should be ignored when trying to find the top candidate\n// for a document.\nvar NON_TOP_CANDIDATE_TAGS$1 = ['br', 'b', 'i', 'label', 'hr', 'area', 'base', 'basefont', 'input', 'img', 'link', 'meta'];\n\nvar NON_TOP_CANDIDATE_TAGS_RE$1 = new RegExp('^(' + NON_TOP_CANDIDATE_TAGS$1.join('|') + ')$', 'i');\n\n// A list of selectors that specify, very clearly, either hNews or other\n// very content-specific style content, like Blogger templates.\n// More examples here: http://microformats.org/wiki/blog-post-formats\nvar HNEWS_CONTENT_SELECTORS$1 = [['.hentry', '.entry-content'], ['entry', '.entry-content'], ['.entry', '.entry_content'], ['.post', '.postbody'], ['.post', '.post_body'], ['.post', '.post-body']];\n\nvar PHOTO_HINTS$1 = ['figure', 'photo', 'image', 'caption'];\nvar PHOTO_HINTS_RE$1 = new RegExp(PHOTO_HINTS$1.join('|'), 'i');\n\n// A list of strings that denote a positive scoring for this content as being\n// an article container. Checked against className and id.\n//\n// TODO: Perhaps have these scale based on their odds of being quality?\nvar POSITIVE_SCORE_HINTS$1 = ['article', 'articlecontent', 'instapaper_body', 'blog', 'body', 'content', 'entry-content-asset', 'entry', 'hentry', 'main', 'Normal', 'page', 'pagination', 'permalink', 'post', 'story', 'text', '[-_]copy', // usatoday\n'\\\\Bcopy'];\n\n// The above list, joined into a matching regular expression\nvar POSITIVE_SCORE_RE$1 = new RegExp(POSITIVE_SCORE_HINTS$1.join('|'), 'i');\n\n// Readability publisher-specific guidelines\nvar READABILITY_ASSET$1 = new RegExp('entry-content-asset', 'i');\n\n// A list of strings that denote a negative scoring for this content as being\n// an article container. Checked against className and id.\n//\n// TODO: Perhaps have these scale based on their odds of being quality?\nvar NEGATIVE_SCORE_HINTS$1 = ['adbox', 'advert', 'author', 'bio', 'bookmark', 'bottom', 'byline', 'clear', 'com-', 'combx', 'comment', 'comment\\\\B', 'contact', 'copy', 'credit', 'crumb', 'date', 'deck', 'excerpt', 'featured', // tnr.com has a featured_content which throws us off\n'foot', 'footer', 'footnote', 'graf', 'head', 'info', 'infotext', // newscientist.com copyright\n'instapaper_ignore', 'jump', 'linebreak', 'link', 'masthead', 'media', 'meta', 'modal', 'outbrain', // slate.com junk\n'promo', 'pr_', // autoblog - press release\n'related', 'respond', 'roundcontent', // lifehacker restricted content warning\n'scroll', 'secondary', 'share', 'shopping', 'shoutbox', 'side', 'sidebar', 'sponsor', 'stamp', 'sub', 'summary', 'tags', 'tools', 'widget'];\n// The above list, joined into a matching regular expression\nvar NEGATIVE_SCORE_RE$1 = new RegExp(NEGATIVE_SCORE_HINTS$1.join('|'), 'i');\n\n// Match a digit. Pretty clear.\n\n\n// Match 2 or more consecutive <br> tags\n\n\n// Match 1 BR tag.\n\n\n// A list of all of the block level tags known in HTML5 and below. Taken from\n// http://bit.ly/qneNIT\n\n\n\n// The removal is implemented as a blacklist and whitelist, this test finds\n// blacklisted elements that aren't whitelisted. We do this all in one\n// expression-both because it's only one pass, and because this skips the\n// serialization for whitelisted nodes.\nvar candidatesBlacklist$1 = UNLIKELY_CANDIDATES_BLACKLIST$1.join('|');\n\n\nvar candidatesWhitelist$1 = UNLIKELY_CANDIDATES_WHITELIST$1.join('|');\n\n\n\n\nvar PARAGRAPH_SCORE_TAGS$1 = new RegExp('^(p|li|span|pre)$', 'i');\nvar CHILD_CONTENT_TAGS$1 = new RegExp('^(td|blockquote|ol|ul|dl)$', 'i');\nvar BAD_TAGS$1 = new RegExp('^(address|form)$', 'i');\n\n// Get the score of a node based on its className and id.\nfunction getWeight(node) {\n var classes = node.attr('class');\n var id = node.attr('id');\n var score = 0;\n\n if (id) {\n // if id exists, try to score on both positive and negative\n if (POSITIVE_SCORE_RE$1.test(id)) {\n score += 25;\n }\n if (NEGATIVE_SCORE_RE$1.test(id)) {\n score -= 25;\n }\n }\n\n if (classes) {\n if (score === 0) {\n // if classes exist and id did not contribute to score\n // try to score on both positive and negative\n if (POSITIVE_SCORE_RE$1.test(classes)) {\n score += 25;\n }\n if (NEGATIVE_SCORE_RE$1.test(classes)) {\n score -= 25;\n }\n }\n\n // even if score has been set by id, add score for\n // possible photo matches\n // \"try to keep photos if we can\"\n if (PHOTO_HINTS_RE$1.test(classes)) {\n score += 10;\n }\n\n // add 25 if class matches entry-content-asset,\n // a class apparently instructed for use in the\n // Readability publisher guidelines\n // https://www.readability.com/developers/guidelines\n if (READABILITY_ASSET$1.test(classes)) {\n score += 25;\n }\n }\n\n return score;\n}\n\n// returns the score of a node based on\n// the node's score attribute\n// returns null if no score set\nfunction getScore($node) {\n return parseFloat($node.attr('score')) || null;\n}\n\n// return 1 for every comma in text\nfunction scoreCommas(text) {\n return (text.match(/,/g) || []).length;\n}\n\nvar idkRe = new RegExp('^(p|pre)$', 'i');\n\nfunction scoreLength(textLength) {\n var tagName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'p';\n\n var chunks = textLength / 50;\n\n if (chunks > 0) {\n var lengthBonus = void 0;\n\n // No idea why p or pre are being tamped down here\n // but just following the source for now\n // Not even sure why tagName is included here,\n // since this is only being called from the context\n // of scoreParagraph\n if (idkRe.test(tagName)) {\n lengthBonus = chunks - 2;\n } else {\n lengthBonus = chunks - 1.25;\n }\n\n return Math.min(Math.max(lengthBonus, 0), 3);\n }\n\n return 0;\n}\n\n// Score a paragraph using various methods. Things like number of\n// commas, etc. Higher is better.\nfunction scoreParagraph$$1(node) {\n var score = 1;\n var text = node.text().trim();\n var textLength = text.length;\n\n // If this paragraph is less than 25 characters, don't count it.\n if (textLength < 25) {\n return 0;\n }\n\n // Add points for any commas within this paragraph\n score += scoreCommas(text);\n\n // For every 50 characters in this paragraph, add another point. Up\n // to 3 points.\n score += scoreLength(textLength);\n\n // Articles can end with short paragraphs when people are being clever\n // but they can also end with short paragraphs setting up lists of junk\n // that we strip. This negative tweaks junk setup paragraphs just below\n // the cutoff threshold.\n if (text.slice(-1) === ':') {\n score -= 1;\n }\n\n return score;\n}\n\nfunction setScore($node, $, score) {\n $node.attr('score', score);\n return $node;\n}\n\nfunction addScore$$1($node, $, amount) {\n try {\n var score = getOrInitScore$$1($node, $) + amount;\n setScore($node, $, score);\n } catch (e) {\n // Ignoring; error occurs in scoreNode\n }\n\n return $node;\n}\n\n// Adds 1/4 of a child's score to its parent\nfunction addToParent$$1(node, $, score) {\n var parent = node.parent();\n if (parent) {\n addScore$$1(parent, $, score * 0.25);\n }\n\n return node;\n}\n\n// gets and returns the score if it exists\n// if not, initializes a score based on\n// the node's tag type\nfunction getOrInitScore$$1($node, $) {\n var weightNodes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n\n var score = getScore($node);\n\n if (score) {\n return score;\n }\n\n score = scoreNode$$1($node);\n\n if (weightNodes) {\n score += getWeight($node);\n }\n\n addToParent$$1($node, $, score);\n\n return score;\n}\n\n// Score an individual node. Has some smarts for paragraphs, otherwise\n// just scores based on tag.\nfunction scoreNode$$1($node) {\n var _$node$get = $node.get(0),\n tagName = _$node$get.tagName;\n\n // TODO: Consider ordering by most likely.\n // E.g., if divs are a more common tag on a page,\n // Could save doing that regex test on every node AP\n\n\n if (PARAGRAPH_SCORE_TAGS$1.test(tagName)) {\n return scoreParagraph$$1($node);\n } else if (tagName.toLowerCase() === 'div') {\n return 5;\n } else if (CHILD_CONTENT_TAGS$1.test(tagName)) {\n return 3;\n } else if (BAD_TAGS$1.test(tagName)) {\n return -3;\n } else if (tagName.toLowerCase() === 'th') {\n return -5;\n }\n\n return 0;\n}\n\nfunction convertSpans$1($node, $) {\n if ($node.get(0)) {\n var _$node$get = $node.get(0),\n tagName = _$node$get.tagName;\n\n if (tagName === 'span') {\n // convert spans to divs\n convertNodeTo$$1($node, $, 'div');\n }\n }\n}\n\nfunction addScoreTo($node, $, score) {\n if ($node) {\n convertSpans$1($node, $);\n addScore$$1($node, $, score);\n }\n}\n\nfunction scorePs($, weightNodes) {\n $('p, pre').not('[score]').each(function (index, node) {\n // The raw score for this paragraph, before we add any parent/child\n // scores.\n var $node = $(node);\n $node = setScore($node, $, getOrInitScore$$1($node, $, weightNodes));\n\n var $parent = $node.parent();\n var rawScore = scoreNode$$1($node);\n\n addScoreTo($parent, $, rawScore, weightNodes);\n if ($parent) {\n // Add half of the individual content score to the\n // grandparent\n addScoreTo($parent.parent(), $, rawScore / 2, weightNodes);\n }\n });\n\n return $;\n}\n\n// score content. Parents get the full value of their children's\n// content score, grandparents half\nfunction scoreContent$$1($) {\n var weightNodes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n\n // First, look for special hNews based selectors and give them a big\n // boost, if they exist\n HNEWS_CONTENT_SELECTORS$1.forEach(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n parentSelector = _ref2[0],\n childSelector = _ref2[1];\n\n $(parentSelector + ' ' + childSelector).each(function (index, node) {\n addScore$$1($(node).parent(parentSelector), $, 80);\n });\n });\n\n // Doubling this again\n // Previous solution caused a bug\n // in which parents weren't retaining\n // scores. This is not ideal, and\n // should be fixed.\n scorePs($, weightNodes);\n scorePs($, weightNodes);\n\n return $;\n}\n\n// Now that we have a top_candidate, look through the siblings of\n// it to see if any of them are decently scored. If they are, they\n// may be split parts of the content (Like two divs, a preamble and\n// a body.) Example:\n// http://articles.latimes.com/2009/oct/14/business/fi-bigtvs14\nfunction mergeSiblings($candidate, topScore, $) {\n if (!$candidate.parent().length) {\n return $candidate;\n }\n\n var siblingScoreThreshold = Math.max(10, topScore * 0.25);\n var wrappingDiv = $('<div></div>');\n\n $candidate.parent().children().each(function (index, sibling) {\n var $sibling = $(sibling);\n // Ignore tags like BR, HR, etc\n if (NON_TOP_CANDIDATE_TAGS_RE$1.test(sibling.tagName)) {\n return null;\n }\n\n var siblingScore = getScore($sibling);\n if (siblingScore) {\n if ($sibling.get(0) === $candidate.get(0)) {\n wrappingDiv.append($sibling);\n } else {\n var contentBonus = 0;\n var density = linkDensity($sibling);\n\n // If sibling has a very low link density,\n // give it a small bonus\n if (density < 0.05) {\n contentBonus += 20;\n }\n\n // If sibling has a high link density,\n // give it a penalty\n if (density >= 0.5) {\n contentBonus -= 20;\n }\n\n // If sibling node has the same class as\n // candidate, give it a bonus\n if ($sibling.attr('class') === $candidate.attr('class')) {\n contentBonus += topScore * 0.2;\n }\n\n var newScore = siblingScore + contentBonus;\n\n if (newScore >= siblingScoreThreshold) {\n return wrappingDiv.append($sibling);\n } else if (sibling.tagName === 'p') {\n var siblingContent = $sibling.text();\n var siblingContentLength = textLength(siblingContent);\n\n if (siblingContentLength > 80 && density < 0.25) {\n return wrappingDiv.append($sibling);\n } else if (siblingContentLength <= 80 && density === 0 && hasSentenceEnd(siblingContent)) {\n return wrappingDiv.append($sibling);\n }\n }\n }\n }\n\n return null;\n });\n\n if (wrappingDiv.children().length === 1 && wrappingDiv.children().first().get(0) === $candidate.get(0)) {\n return $candidate;\n }\n\n return wrappingDiv;\n}\n\n// After we've calculated scores, loop through all of the possible\n// candidate nodes we found and find the one with the highest score.\nfunction findTopCandidate$$1($) {\n var $candidate = void 0;\n var topScore = 0;\n\n $('[score]').each(function (index, node) {\n // Ignore tags like BR, HR, etc\n if (NON_TOP_CANDIDATE_TAGS_RE$1.test(node.tagName)) {\n return;\n }\n\n var $node = $(node);\n var score = getScore($node);\n\n if (score > topScore) {\n topScore = score;\n $candidate = $node;\n }\n });\n\n // If we don't have a candidate, return the body\n // or whatever the first element is\n if (!$candidate) {\n return $('body') || $('*').first();\n }\n\n $candidate = mergeSiblings($candidate, topScore, $);\n\n return $candidate;\n}\n\n// Scoring\n\nfunction removeUnlessContent($node, $, weight) {\n // Explicitly save entry-content-asset tags, which are\n // noted as valuable in the Publisher guidelines. For now\n // this works everywhere. We may want to consider making\n // this less of a sure-thing later.\n if ($node.hasClass('entry-content-asset')) {\n return;\n }\n\n var content = normalizeSpaces($node.text());\n\n if (scoreCommas(content) < 10) {\n var pCount = $('p', $node).length;\n var inputCount = $('input', $node).length;\n\n // Looks like a form, too many inputs.\n if (inputCount > pCount / 3) {\n $node.remove();\n return;\n }\n\n var contentLength = content.length;\n var imgCount = $('img', $node).length;\n\n // Content is too short, and there are no images, so\n // this is probably junk content.\n if (contentLength < 25 && imgCount === 0) {\n $node.remove();\n return;\n }\n\n var density = linkDensity($node);\n\n // Too high of link density, is probably a menu or\n // something similar.\n // console.log(weight, density, contentLength)\n if (weight < 25 && density > 0.2 && contentLength > 75) {\n $node.remove();\n return;\n }\n\n // Too high of a link density, despite the score being\n // high.\n if (weight >= 25 && density > 0.5) {\n // Don't remove the node if it's a list and the\n // previous sibling starts with a colon though. That\n // means it's probably content.\n var tagName = $node.get(0).tagName.toLowerCase();\n var nodeIsList = tagName === 'ol' || tagName === 'ul';\n if (nodeIsList) {\n var previousNode = $node.prev();\n if (previousNode && normalizeSpaces(previousNode.text()).slice(-1) === ':') {\n return;\n }\n }\n\n $node.remove();\n return;\n }\n\n var scriptCount = $('script', $node).length;\n\n // Too many script tags, not enough content.\n if (scriptCount > 0 && contentLength < 150) {\n $node.remove();\n return;\n }\n }\n}\n\n// Given an article, clean it of some superfluous content specified by\n// tags. Things like forms, ads, etc.\n//\n// Tags is an array of tag name's to search through. (like div, form,\n// etc)\n//\n// Return this same doc.\nfunction cleanTags$$1($article, $) {\n $(CLEAN_CONDITIONALLY_TAGS, $article).each(function (index, node) {\n var $node = $(node);\n // If marked to keep, skip it\n if ($node.hasClass(KEEP_CLASS) || $node.find('.' + KEEP_CLASS).length > 0) return;\n\n var weight = getScore($node);\n if (!weight) {\n weight = getOrInitScore$$1($node, $);\n setScore($node, $, weight);\n }\n\n // drop node if its weight is < 0\n if (weight < 0) {\n $node.remove();\n } else {\n // deteremine if node seems like content\n removeUnlessContent($node, $, weight);\n }\n });\n\n return $;\n}\n\nfunction cleanHeaders($article, $) {\n var title = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';\n\n $(HEADER_TAG_LIST, $article).each(function (index, header) {\n var $header = $(header);\n // Remove any headers that appear before all other p tags in the\n // document. This probably means that it was part of the title, a\n // subtitle or something else extraneous like a datestamp or byline,\n // all of which should be handled by other metadata handling.\n if ($($header, $article).prevAll('p').length === 0) {\n return $header.remove();\n }\n\n // Remove any headers that match the title exactly.\n if (normalizeSpaces($(header).text()) === title) {\n return $header.remove();\n }\n\n // If this header has a negative weight, it's probably junk.\n // Get rid of it.\n if (getWeight($(header)) < 0) {\n return $header.remove();\n }\n\n return $header;\n });\n\n return $;\n}\n\n// Rewrite the tag name to div if it's a top level node like body or\n// html to avoid later complications with multiple body tags.\nfunction rewriteTopLevel$$1(article, $) {\n // I'm not using context here because\n // it's problematic when converting the\n // top-level/root node - AP\n $ = convertNodeTo$$1($('html'), $, 'div');\n $ = convertNodeTo$$1($('body'), $, 'div');\n\n return $;\n}\n\nfunction absolutize($, rootUrl, attr, $content) {\n $('[' + attr + ']', $content).each(function (_, node) {\n var attrs = getAttrs(node);\n var url = attrs[attr];\n\n if (url) {\n var absoluteUrl = URL.resolve(rootUrl, url);\n setAttr(node, attr, absoluteUrl);\n }\n });\n}\n\nfunction makeLinksAbsolute$$1($content, $, url) {\n ['href', 'src'].forEach(function (attr) {\n return absolutize($, url, attr, $content);\n });\n\n return $content;\n}\n\nfunction textLength(text) {\n return text.trim().replace(/\\s+/g, ' ').length;\n}\n\n// Determines what percentage of the text\n// in a node is link text\n// Takes a node, returns a float\nfunction linkDensity($node) {\n var totalTextLength = textLength($node.text());\n\n var linkText = $node.find('a').text();\n var linkLength = textLength(linkText);\n\n if (totalTextLength > 0) {\n return linkLength / totalTextLength;\n } else if (totalTextLength === 0 && linkLength > 0) {\n return 1;\n }\n\n return 0;\n}\n\n// Given a node type to search for, and a list of meta tag names to\n// search for, find a meta tag associated.\nfunction extractFromMeta$$1($, metaNames, cachedNames) {\n var cleanTags$$1 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\n\n var foundNames = metaNames.filter(function (name) {\n return cachedNames.indexOf(name) !== -1;\n });\n\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n var _loop = function _loop() {\n var name = _step.value;\n\n var type = 'name';\n var value = 'value';\n\n var nodes = $('meta[' + type + '=\"' + name + '\"]');\n\n // Get the unique value of every matching node, in case there\n // are two meta tags with the same name and value.\n // Remove empty values.\n var values = nodes.map(function (index, node) {\n return $(node).attr(value);\n }).toArray().filter(function (text) {\n return text !== '';\n });\n\n // If we have more than one value for the same name, we have a\n // conflict and can't trust any of them. Skip this name. If we have\n // zero, that means our meta tags had no values. Skip this name\n // also.\n if (values.length === 1) {\n var metaValue = void 0;\n // Meta values that contain HTML should be stripped, as they\n // weren't subject to cleaning previously.\n if (cleanTags$$1) {\n metaValue = stripTags(values[0], $);\n } else {\n metaValue = values[0];\n }\n\n return {\n v: metaValue\n };\n }\n };\n\n for (var _iterator = _getIterator(foundNames), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var _ret = _loop();\n\n if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === \"object\") return _ret.v;\n }\n\n // If nothing is found, return null\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return null;\n}\n\nfunction isGoodNode($node, maxChildren) {\n // If it has a number of children, it's more likely a container\n // element. Skip it.\n if ($node.children().length > maxChildren) {\n return false;\n }\n // If it looks to be within a comment, skip it.\n if (withinComment$$1($node)) {\n return false;\n }\n\n return true;\n}\n\n// Given a a list of selectors find content that may\n// be extractable from the document. This is for flat\n// meta-information, like author, title, date published, etc.\nfunction extractFromSelectors$$1($, selectors) {\n var maxChildren = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n var textOnly = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = _getIterator(selectors), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var selector = _step.value;\n\n var nodes = $(selector);\n\n // If we didn't get exactly one of this selector, this may be\n // a list of articles or comments. Skip it.\n if (nodes.length === 1) {\n var $node = $(nodes[0]);\n\n if (isGoodNode($node, maxChildren)) {\n var content = void 0;\n if (textOnly) {\n content = $node.text();\n } else {\n content = $node.html();\n }\n\n if (content) {\n return content;\n }\n }\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return null;\n}\n\n// strips all tags from a string of text\nfunction stripTags(text, $) {\n // Wrapping text in html element prevents errors when text\n // has no html\n var cleanText = $('<span>' + text + '</span>').text();\n return cleanText === '' ? text : cleanText;\n}\n\nfunction withinComment$$1($node) {\n var parents = $node.parents().toArray();\n var commentParent = parents.find(function (parent) {\n var attrs = getAttrs(parent);\n var nodeClass = attrs.class,\n id = attrs.id;\n\n var classAndId = nodeClass + ' ' + id;\n return classAndId.includes('comment');\n });\n\n return commentParent !== undefined;\n}\n\n// Given a node, determine if it's article-like enough to return\n// param: node (a cheerio node)\n// return: boolean\n\nfunction nodeIsSufficient($node) {\n return $node.text().trim().length >= 100;\n}\n\nfunction isWordpress($) {\n return $(IS_WP_SELECTOR).length > 0;\n}\n\nfunction getAttrs(node) {\n var attribs = node.attribs,\n attributes = node.attributes;\n\n\n if (!attribs && attributes) {\n var attrs = _Reflect$ownKeys(attributes).reduce(function (acc, index) {\n var attr = attributes[index];\n\n if (!attr.name || !attr.value) return acc;\n\n acc[attr.name] = attr.value;\n return acc;\n }, {});\n return attrs;\n }\n\n return attribs;\n}\n\nfunction setAttr(node, attr, val) {\n if (node.attribs) {\n node.attribs[attr] = val;\n } else if (node.attributes) {\n node.setAttribute(attr, val);\n }\n\n return node;\n}\n\nfunction setAttrs(node, attrs) {\n if (node.attribs) {\n node.attribs = attrs;\n } else if (node.attributes) {\n while (node.attributes.length > 0) {\n node.removeAttribute(node.attributes[0].name);\n }\n\n _Reflect$ownKeys(attrs).forEach(function (key) {\n node.setAttribute(key, attrs[key]);\n });\n }\n\n return node;\n}\n\n// DOM manipulation\n\nvar IS_LINK = new RegExp('https?://', 'i');\nvar IS_IMAGE = new RegExp('.(png|gif|jpe?g)', 'i');\n\nvar TAGS_TO_REMOVE = ['script', 'style', 'form'].join(',');\n\n// Convert all instances of images with potentially\n// lazy loaded images into normal images.\n// Many sites will have img tags with no source, or an image tag with a src\n// attribute that a is a placeholer. We need to be able to properly fill in\n// the src attribute so the images are no longer lazy loaded.\nfunction convertLazyLoadedImages($) {\n $('img').each(function (_, img) {\n var attrs = getAttrs(img);\n\n _Reflect$ownKeys(attrs).forEach(function (attr) {\n var value = attrs[attr];\n\n if (attr !== 'src' && IS_LINK.test(value) && IS_IMAGE.test(value)) {\n $(img).attr('src', value);\n }\n });\n });\n\n return $;\n}\n\nfunction isComment(index, node) {\n return node.type === 'comment';\n}\n\nfunction cleanComments($) {\n $.root().find('*').contents().filter(isComment).remove();\n\n return $;\n}\n\nfunction clean($) {\n $(TAGS_TO_REMOVE).remove();\n\n $ = cleanComments($);\n return $;\n}\n\nvar Resource = {\n\n // Create a Resource.\n //\n // :param url: The URL for the document we should retrieve.\n // :param response: If set, use as the response rather than\n // attempting to fetch it ourselves. Expects a\n // string.\n create: function create(url, preparedResponse, parsedUrl) {\n var _this = this;\n\n return _asyncToGenerator(_regeneratorRuntime.mark(function _callee() {\n var result, validResponse;\n return _regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n result = void 0;\n\n if (!preparedResponse) {\n _context.next = 6;\n break;\n }\n\n validResponse = {\n statusMessage: 'OK',\n statusCode: 200,\n headers: {\n 'content-type': 'text/html',\n 'content-length': 500\n }\n };\n\n\n result = { body: preparedResponse, response: validResponse };\n _context.next = 9;\n break;\n\n case 6:\n _context.next = 8;\n return fetchResource$1(url, parsedUrl);\n\n case 8:\n result = _context.sent;\n\n case 9:\n if (!result.error) {\n _context.next = 12;\n break;\n }\n\n result.failed = true;\n return _context.abrupt('return', result);\n\n case 12:\n return _context.abrupt('return', _this.generateDoc(result));\n\n case 13:\n case 'end':\n return _context.stop();\n }\n }\n }, _callee, _this);\n }))();\n },\n generateDoc: function generateDoc(_ref) {\n var content = _ref.body,\n response = _ref.response;\n var contentType = response.headers['content-type'];\n\n // TODO: Implement is_text function from\n // https://github.com/ReadabilityHoldings/readability/blob/8dc89613241d04741ebd42fa9fa7df1b1d746303/readability/utils/text.py#L57\n\n if (!contentType.includes('html') && !contentType.includes('text')) {\n throw new Error('Content does not appear to be text.');\n }\n\n var $ = this.encodeDoc({ content: content, contentType: contentType });\n\n if ($.root().children().length === 0) {\n throw new Error('No children, likely a bad parse.');\n }\n\n $ = normalizeMetaTags($);\n $ = convertLazyLoadedImages($);\n $ = clean($);\n\n return $;\n },\n encodeDoc: function encodeDoc(_ref2) {\n var content = _ref2.content,\n contentType = _ref2.contentType;\n\n var encoding = getEncoding(contentType);\n var decodedContent = iconv.decode(content, encoding);\n var $ = cheerio.load(decodedContent);\n\n // after first cheerio.load, check to see if encoding matches\n var metaContentType = $('meta[http-equiv=content-type]').attr('content');\n var properEncoding = getEncoding(metaContentType);\n\n // if encodings in the header/body dont match, use the one in the body\n if (properEncoding !== encoding) {\n decodedContent = iconv.decode(content, properEncoding);\n $ = cheerio.load(decodedContent);\n }\n\n return $;\n }\n};\n\nvar merge = function merge(extractor, domains) {\n return domains.reduce(function (acc, domain) {\n acc[domain] = extractor;\n return acc;\n }, {});\n};\n\nfunction mergeSupportedDomains(extractor) {\n return extractor.supportedDomains ? merge(extractor, [extractor.domain].concat(_toConsumableArray(extractor.supportedDomains))) : merge(extractor, [extractor.domain]);\n}\n\nvar BloggerExtractor = {\n domain: 'blogspot.com',\n content: {\n // Blogger is insane and does not load its content\n // initially in the page, but it's all there\n // in noscript\n selectors: ['.post-content noscript'],\n\n // Selectors to remove from the extracted content\n clean: [],\n\n // Convert the noscript tag to a div\n transforms: {\n noscript: 'div'\n }\n },\n\n author: {\n selectors: ['.post-author-name']\n },\n\n title: {\n selectors: ['.post h2.title']\n },\n\n date_published: {\n selectors: ['span.publishdate']\n }\n};\n\nvar NYMagExtractor = {\n domain: 'nymag.com',\n content: {\n // Order by most likely. Extractor will stop on first occurrence\n selectors: ['div.article-content', 'section.body', 'article.article'],\n\n // Selectors to remove from the extracted content\n clean: ['.ad', '.single-related-story'],\n\n // Object of tranformations to make on matched elements\n // Each key is the selector, each value is the tag to\n // transform to.\n // If a function is given, it should return a string\n // to convert to or nothing (in which case it will not perform\n // the transformation.\n transforms: {\n // Convert h1s to h2s\n h1: 'h2',\n\n // Convert lazy-loaded noscript images to figures\n noscript: function noscript($node, $) {\n var $children = $.browser ? $($node.text()) : $node.children();\n if ($children.length === 1 && $children.get(0) !== undefined && $children.get(0).tagName.toLowerCase() === 'img') {\n return 'figure';\n }\n\n return null;\n }\n }\n },\n\n title: {\n selectors: ['h1.lede-feature-title', 'h1.headline-primary', 'h1']\n },\n\n author: {\n selectors: ['.by-authors', '.lede-feature-author']\n },\n\n dek: {\n selectors: ['.lede-feature-teaser']\n },\n\n date_published: {\n selectors: [['time.article-timestamp[datetime]', 'datetime'], 'time.article-timestamp']\n }\n};\n\nvar WikipediaExtractor = {\n domain: 'wikipedia.org',\n content: {\n selectors: ['#mw-content-text'],\n\n defaultCleaner: false,\n\n // transform top infobox to an image with caption\n transforms: {\n '.infobox img': function infoboxImg($node) {\n var $parent = $node.parents('.infobox');\n // Only prepend the first image in .infobox\n if ($parent.children('img').length === 0) {\n $parent.prepend($node);\n }\n },\n '.infobox caption': 'figcaption',\n '.infobox': 'figure'\n },\n\n // Selectors to remove from the extracted content\n clean: ['.mw-editsection', 'figure tr, figure td, figure tbody', '#toc', '.navbox']\n\n },\n\n author: 'Wikipedia Contributors',\n\n title: {\n selectors: ['h2.title']\n },\n\n date_published: {\n selectors: ['#footer-info-lastmod']\n }\n\n};\n\nvar TwitterExtractor = {\n domain: 'twitter.com',\n\n content: {\n transforms: {\n // We're transforming essentially the whole page here.\n // Twitter doesn't have nice selectors, so our initial\n // selector grabs the whole page, then we're re-writing\n // it to fit our needs before we clean it up.\n '.permalink[role=main]': function permalinkRoleMain($node, $) {\n var tweets = $node.find('.tweet');\n var $tweetContainer = $('<div id=\"TWEETS_GO_HERE\"></div>');\n $tweetContainer.append(tweets);\n $node.replaceWith($tweetContainer);\n },\n\n // Twitter wraps @ with s, which\n // renders as a strikethrough\n s: 'span'\n },\n\n selectors: ['.permalink[role=main]'],\n\n defaultCleaner: false,\n\n clean: ['.stream-item-footer', 'button', '.tweet-details-fixer']\n },\n\n author: {\n selectors: ['.tweet.permalink-tweet .username']\n },\n\n date_published: {\n selectors: [['.permalink-tweet ._timestamp[data-time-ms]', 'data-time-ms']]\n }\n\n};\n\nvar NYTimesExtractor = {\n domain: 'www.nytimes.com',\n\n title: {\n selectors: ['h1.g-headline', 'h1[itemprop=\"headline\"]', 'h1.headline']\n },\n\n author: {\n selectors: [['meta[name=\"author\"]', 'value'], '.g-byline', '.byline']\n },\n\n content: {\n selectors: ['div.g-blocks', 'article#story'],\n\n transforms: {\n 'img.g-lazy': function imgGLazy($node) {\n var src = $node.attr('src');\n // const widths = $node.attr('data-widths')\n // .slice(1)\n // .slice(0, -1)\n // .split(',');\n // if (widths.length) {\n // width = widths.slice(-1);\n // } else {\n // width = '900';\n // }\n var width = 640;\n\n src = src.replace('{{size}}', width);\n $node.attr('src', src);\n }\n },\n\n clean: ['.ad', 'header#story-header', '.story-body-1 .lede.video', '.visually-hidden', '#newsletter-promo', '.promo', '.comments-button', '.hidden', '.comments', '.supplemental', '.nocontent', '.story-footer-links']\n },\n\n date_published: {\n selectors: [['meta[name=\"article:published\"]', 'value']]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n dek: null,\n\n next_page_url: null,\n\n excerpt: null\n};\n\n// Rename CustomExtractor\n// to fit your publication\nvar TheAtlanticExtractor = {\n domain: 'www.theatlantic.com',\n title: {\n selectors: ['h1.hed']\n },\n\n author: {\n selectors: ['article#article .article-cover-extra .metadata .byline a']\n },\n\n content: {\n selectors: [['.article-cover figure.lead-img', '.article-body'], '.article-body'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: [],\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['.partner-box', '.callout']\n },\n\n date_published: {\n selectors: [['time[itemProp=\"datePublished\"]', 'datetime']]\n },\n\n lead_image_url: null,\n\n next_page_url: null,\n\n excerpt: null\n};\n\n// Rename CustomExtractor\n// to fit your publication\n// (e.g., NYTimesExtractor)\nvar NewYorkerExtractor = {\n domain: 'www.newyorker.com',\n title: {\n selectors: ['h1.title']\n },\n\n author: {\n selectors: ['.contributors']\n },\n\n content: {\n selectors: ['div#articleBody', 'div.articleBody'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: [],\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n },\n\n date_published: {\n selectors: [['meta[name=\"article:published_time\"]', 'value'], ['time[itemProp=\"datePublished\"]', 'content']],\n\n timezone: 'America/New_York'\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n dek: {\n selectors: ['.dek', 'h2.dek']\n },\n\n next_page_url: null,\n\n excerpt: null\n};\n\n// Rename CustomExtractor\n// to fit your publication\n// (e.g., NYTimesExtractor)\nvar WiredExtractor = {\n domain: 'www.wired.com',\n title: {\n selectors: ['h1.post-title']\n },\n\n author: {\n selectors: ['a[rel=\"author\"]']\n },\n\n content: {\n selectors: ['article.content'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: [],\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['.visually-hidden', 'figcaption img.photo']\n },\n\n date_published: {\n selectors: [['meta[itemprop=\"datePublished\"]', 'value']]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n dek: {\n selectors: []\n },\n\n next_page_url: null,\n\n excerpt: null\n};\n\n// Rename CustomExtractor\n// to fit your publication\n// (e.g., NYTimesExtractor)\nvar MSNExtractor = {\n domain: 'www.msn.com',\n title: {\n selectors: ['h1']\n },\n\n author: {\n selectors: ['span.authorname-txt']\n },\n\n content: {\n selectors: ['div.richtext'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: [],\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['span.caption']\n },\n\n date_published: {\n selectors: ['span.time']\n },\n\n lead_image_url: {\n selectors: []\n },\n\n dek: {\n selectors: []\n },\n\n next_page_url: null,\n\n excerpt: null\n};\n\n// Rename CustomExtractor\n// to fit your publication\n// (e.g., NYTimesExtractor)\nvar YahooExtractor = {\n domain: 'www.yahoo.com',\n title: {\n selectors: ['header.canvas-header']\n },\n\n author: {\n selectors: ['span.provider-name']\n },\n\n content: {\n selectors: [\n // enter content selectors\n '.content-canvas'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: [],\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['.figure-caption']\n },\n\n date_published: {\n selectors: [['time.date[datetime]', 'datetime']]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n dek: {\n selectors: [\n // enter dek selectors\n ]\n },\n\n next_page_url: null,\n\n excerpt: null\n};\n\n// Rename CustomExtractor\n// to fit your publication\n// (e.g., NYTimesExtractor)\nvar BuzzfeedExtractor = {\n domain: 'www.buzzfeed.com',\n title: {\n selectors: ['h1[id=\"post-title\"]']\n },\n\n author: {\n selectors: ['a[data-action=\"user/username\"]', 'byline__author']\n },\n\n content: {\n selectors: [['.longform_custom_header_media', '#buzz_sub_buzz'], '#buzz_sub_buzz'],\n\n defaultCleaner: false,\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {\n h2: 'b',\n\n 'div.longform_custom_header_media': function divLongform_custom_header_media($node) {\n if ($node.has('img') && $node.has('.longform_header_image_source')) {\n return 'figure';\n }\n\n return null;\n },\n\n 'figure.longform_custom_header_media .longform_header_image_source': 'figcaption'\n },\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['.instapaper_ignore', '.suplist_list_hide .buzz_superlist_item .buzz_superlist_number_inline', '.share-box', '.print']\n },\n\n date_published: {\n selectors: ['.buzz-datetime']\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n dek: {\n selectors: []\n },\n\n next_page_url: null,\n\n excerpt: null\n};\n\n// Rename CustomExtractor\n// to fit your publication\n// (e.g., NYTimesExtractor)\nvar WikiaExtractor = {\n domain: 'fandom.wikia.com',\n title: {\n selectors: ['h1.entry-title']\n },\n\n author: {\n selectors: ['.author vcard', '.fn']\n },\n\n content: {\n selectors: ['.grid-content', '.entry-content'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: [],\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n },\n\n date_published: {\n selectors: [['meta[name=\"article:published_time\"]', 'value']]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n dek: {\n selectors: []\n },\n\n next_page_url: null,\n\n excerpt: null\n};\n\n// Rename CustomExtractor\n// to fit your publication\n// (e.g., NYTimesExtractor)\nvar LittleThingsExtractor = {\n domain: 'www.littlethings.com',\n title: {\n selectors: ['h1.post-title']\n },\n\n author: {\n selectors: [['meta[name=\"author\"]', 'value']]\n },\n\n content: {\n selectors: [\n // enter content selectors\n '.mainContentIntro', '.content-wrapper'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: [],\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n next_page_url: null,\n\n excerpt: null\n};\n\n// Rename CustomExtractor\n// to fit your publication\n// (e.g., NYTimesExtractor)\nvar PoliticoExtractor = {\n domain: 'www.politico.com',\n title: {\n selectors: [\n // enter title selectors\n ['meta[name=\"og:title\"]', 'value']]\n },\n\n author: {\n selectors: ['.story-main-content .byline .vcard']\n },\n\n content: {\n selectors: [\n // enter content selectors\n '.story-main-content', '.content-group', '.story-core', '.story-text'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: [],\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['figcaption']\n },\n\n date_published: {\n selectors: [['.story-main-content .timestamp time[datetime]', 'datetime']]\n },\n\n lead_image_url: {\n selectors: [\n // enter lead_image_url selectors\n ['meta[name=\"og:image\"]', 'value']]\n },\n\n dek: {\n selectors: []\n },\n\n next_page_url: null,\n\n excerpt: null\n};\n\nvar DeadspinExtractor = {\n domain: 'deadspin.com',\n\n supportedDomains: ['jezebel.com', 'lifehacker.com', 'kotaku.com', 'gizmodo.com', 'jalopnik.com', 'kinja.com'],\n\n title: {\n selectors: ['h1.headline']\n },\n\n author: {\n selectors: ['.author']\n },\n\n content: {\n selectors: ['.post-content', '.entry-content'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {\n 'iframe.lazyload[data-recommend-id^=\"youtube://\"]': function iframeLazyloadDataRecommendIdYoutube($node) {\n var youtubeId = $node.attr('id').split('youtube-')[1];\n $node.attr('src', 'https://www.youtube.com/embed/' + youtubeId);\n }\n },\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['.magnifier', '.lightbox']\n },\n\n date_published: {\n selectors: [['time.updated[datetime]', 'datetime']]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n dek: {\n selectors: [\n // enter selectors\n ]\n },\n\n next_page_url: {\n selectors: [\n // enter selectors\n ]\n },\n\n excerpt: {\n selectors: [\n // enter selectors\n ]\n }\n};\n\n// Rename CustomExtractor\n// to fit your publication\n// (e.g., NYTimesExtractor)\nvar BroadwayWorldExtractor = {\n domain: 'www.broadwayworld.com',\n title: {\n selectors: ['h1.article-title']\n },\n\n author: {\n selectors: ['span[itemprop=author]']\n },\n\n content: {\n selectors: ['div[itemprop=articlebody]'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n },\n\n date_published: {\n selectors: [['meta[itemprop=datePublished]', 'value']]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n dek: {\n selectors: []\n },\n\n next_page_url: {\n selectors: [\n // enter selectors\n ]\n },\n\n excerpt: {\n selectors: [\n // enter selectors\n ]\n }\n};\n\n// Rename CustomExtractor\n// to fit your publication\n// (e.g., NYTimesExtractor)\nvar ApartmentTherapyExtractor = {\n domain: 'www.apartmenttherapy.com',\n title: {\n selectors: ['h1.headline']\n },\n\n author: {\n selectors: ['.PostByline__name']\n },\n\n content: {\n selectors: ['div.post__content'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {\n 'div[data-render-react-id=\"images/LazyPicture\"]': function divDataRenderReactIdImagesLazyPicture($node, $) {\n var data = JSON.parse($node.attr('data-props'));\n var src = data.sources[0].src;\n\n var $img = $('<img />').attr('src', src);\n $node.replaceWith($img);\n }\n },\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n },\n\n date_published: {\n selectors: [['.PostByline__timestamp[datetime]', 'datetime']]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n dek: {\n selectors: []\n },\n\n next_page_url: {\n selectors: [\n // enter selectors\n ]\n },\n\n excerpt: {\n selectors: [\n // enter selectors\n ]\n }\n};\n\nvar MediumExtractor = {\n domain: 'medium.com',\n\n supportedDomains: ['trackchanges.postlight.com'],\n\n title: {\n selectors: ['h1']\n },\n\n author: {\n selectors: [['meta[name=\"author\"]', 'value']]\n },\n\n content: {\n selectors: [['.section-content'], '.section-content', 'article > div > section'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {\n // Re-write lazy-loaded youtube videos\n iframe: function iframe($node) {\n var ytRe = /https:\\/\\/i.embed.ly\\/.+url=https:\\/\\/i\\.ytimg\\.com\\/vi\\/(\\w+)\\//;\n var thumb = decodeURIComponent($node.attr('data-thumbnail'));\n\n if (ytRe.test(thumb)) {\n var _thumb$match = thumb.match(ytRe),\n _thumb$match2 = _slicedToArray(_thumb$match, 2),\n _ = _thumb$match2[0],\n youtubeId = _thumb$match2[1]; // eslint-disable-line\n\n\n $node.attr('src', 'https://www.youtube.com/embed/' + youtubeId);\n var $parent = $node.parents('figure');\n var $caption = $parent.find('figcaption');\n $parent.empty().append([$node, $caption]);\n }\n },\n\n // rewrite figures to pull out image and caption, remove rest\n figure: function figure($node) {\n // ignore if figure has an iframe\n if ($node.find('iframe').length > 0) return;\n\n var $img = $node.find('img').slice(-1)[0];\n var $caption = $node.find('figcaption');\n $node.empty().append([$img, $caption]);\n }\n },\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n },\n\n date_published: {\n selectors: [['time[datetime]', 'datetime']]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n dek: {\n selectors: [\n // enter selectors\n ]\n },\n\n next_page_url: {\n selectors: [\n // enter selectors\n ]\n },\n\n excerpt: {\n selectors: [\n // enter selectors\n ]\n }\n};\n\nvar WwwTmzComExtractor = {\n domain: 'www.tmz.com',\n\n title: {\n selectors: ['.post-title-breadcrumb', 'h1', '.headline']\n },\n\n author: 'TMZ STAFF',\n\n date_published: {\n selectors: ['.article-posted-date'],\n\n timezone: 'America/Los_Angeles'\n },\n\n dek: {\n selectors: [\n // enter selectors\n ]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['.article-content', '.all-post-body'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['.lightbox-link']\n }\n};\n\nvar WwwWashingtonpostComExtractor = {\n domain: 'www.washingtonpost.com',\n\n title: {\n selectors: ['h1', '#topper-headline-wrapper']\n },\n\n author: {\n selectors: ['.pb-byline']\n },\n\n date_published: {\n selectors: [['.pb-timestamp[itemprop=\"datePublished\"]', 'content']]\n },\n\n dek: {\n selectors: []\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['.article-body'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {\n 'div.inline-content': function divInlineContent($node) {\n if ($node.has('img,iframe,video').length > 0) {\n return 'figure';\n }\n\n $node.remove();\n return null;\n },\n '.pb-caption': 'figcaption'\n },\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['.interstitial-link', '.newsletter-inline-unit']\n }\n};\n\nvar WwwHuffingtonpostComExtractor = {\n domain: 'www.huffingtonpost.com',\n\n title: {\n selectors: ['h1.headline__title']\n },\n\n author: {\n selectors: ['span.author-card__details__name']\n },\n\n date_published: {\n selectors: [['meta[name=\"article:modified_time\"]', 'value'], ['meta[name=\"article:published_time\"]', 'value']]\n },\n\n dek: {\n selectors: ['h2.headline__subtitle']\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['div.entry__body'],\n\n defaultCleaner: false,\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {\n // 'div.top-media': ($node) => {\n // const $figure = $node.children('figure');\n // $node.replaceWith($figure);\n // },\n },\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['.pull-quote', '.tag-cloud', '.embed-asset', '.below-entry', '.entry-corrections', '#suggested-story']\n }\n};\n\nvar NewrepublicComExtractor = {\n domain: 'newrepublic.com',\n\n title: {\n selectors: ['h1.article-headline', '.minutes-primary h1.minute-title']\n },\n\n author: {\n selectors: ['div.author-list', '.minutes-primary h3.minute-byline']\n },\n\n date_published: {\n selectors: [['meta[name=\"article:published_time\"]', 'value']],\n\n timezone: 'America/New_York'\n },\n\n dek: {\n selectors: ['h2.article-subhead']\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: [['.article-cover', 'div.content-body'], ['.minute-image', '.minutes-primary div.content-body']],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['aside']\n }\n};\n\nvar MoneyCnnComExtractor = {\n domain: 'money.cnn.com',\n\n title: {\n selectors: ['.article-title']\n },\n\n author: {\n selectors: ['.byline a']\n },\n\n date_published: {\n selectors: [['meta[name=\"date\"]', 'value']],\n\n timezone: 'GMT'\n },\n\n dek: {\n selectors: ['#storytext h2']\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['#storytext'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['.inStoryHeading']\n }\n};\n\nvar WwwThevergeComExtractor = {\n domain: 'www.theverge.com',\n\n supportedDomains: ['www.polygon.com'],\n\n title: {\n selectors: ['h1']\n },\n\n author: {\n selectors: [['meta[name=\"author\"]', 'value']]\n },\n\n date_published: {\n selectors: [['meta[name=\"article:published_time\"]', 'value']]\n },\n\n dek: {\n selectors: ['h2.p-dek']\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: [\n // feature template multi-match\n ['.c-entry-hero .e-image', '.c-entry-intro', '.c-entry-content'],\n // regular post multi-match\n ['.e-image--hero', '.c-entry-content'],\n // feature template fallback\n '.l-wrapper .l-feature',\n // regular post fallback\n 'div.c-entry-content'],\n\n // Transform lazy-loaded images\n transforms: {\n noscript: function noscript($node) {\n var $children = $node.children();\n if ($children.length === 1 && $children.get(0).tagName === 'img') {\n return 'span';\n }\n\n return null;\n }\n },\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['.aside', 'img.c-dynamic-image']\n }\n};\n\nvar WwwCnnComExtractor = {\n domain: 'www.cnn.com',\n\n title: {\n selectors: ['h1.pg-headline', 'h1']\n },\n\n author: {\n selectors: ['.metadata__byline__author']\n },\n\n date_published: {\n selectors: [['meta[name=\"pubdate\"]', 'value']]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: [\n // a more specific selector to grab the lead image and the body\n ['.media__video--thumbnail', '.zn-body-text'],\n // a fallback for the above\n '.zn-body-text', 'div[itemprop=\"articleBody\"]'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {\n '.zn-body__paragraph, .el__leafmedia--sourced-paragraph': function znBody__paragraphEl__leafmediaSourcedParagraph($node) {\n var $text = $node.html();\n if ($text) {\n return 'p';\n }\n\n return null;\n },\n\n // this transform cleans the short, all-link sections linking\n // to related content but not marked as such in any way.\n '.zn-body__paragraph': function znBody__paragraph($node) {\n if ($node.has('a')) {\n if ($node.text().trim() === $node.find('a').text().trim()) {\n $node.remove();\n }\n }\n },\n\n '.media__video--thumbnail': 'figure'\n\n },\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n }\n};\n\nvar WwwAolComExtractor = {\n domain: 'www.aol.com',\n\n title: {\n selectors: ['h1.p-article__title']\n },\n\n author: {\n selectors: [['meta[name=\"author\"]', 'value']]\n },\n\n date_published: {\n selectors: ['.p-article__byline__date'],\n\n timezone: 'America/New_York'\n },\n\n dek: {\n selectors: [\n // enter selectors\n ]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['.article-content'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n }\n};\n\nvar WwwYoutubeComExtractor = {\n domain: 'www.youtube.com',\n\n title: {\n selectors: ['.watch-title', 'h1.watch-title-container']\n },\n\n author: {\n selectors: ['.yt-user-info']\n },\n\n date_published: {\n selectors: [['meta[itemProp=\"datePublished\"]', 'value']],\n\n timezone: 'GMT'\n },\n\n dek: {\n selectors: [\n // enter selectors\n ]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n defaultCleaner: false,\n\n selectors: [['#player-api', '#eow-description']],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {\n '#player-api': function playerApi($node, $) {\n var videoId = $('meta[itemProp=\"videoId\"]').attr('value');\n $node.html('\\n <iframe src=\"https://www.youtube.com/embed/' + videoId + '\" frameborder=\"0\" allowfullscreen></iframe>');\n }\n },\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n }\n};\n\nvar WwwTheguardianComExtractor = {\n domain: 'www.theguardian.com',\n\n title: {\n selectors: ['.content__headline']\n },\n\n author: {\n selectors: ['p.byline']\n },\n\n date_published: {\n selectors: [['meta[name=\"article:published_time\"]', 'value']]\n },\n\n dek: {\n selectors: ['.content__standfirst']\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['.content__article-body'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['.hide-on-mobile', '.inline-icon']\n }\n};\n\nvar WwwSbnationComExtractor = {\n domain: 'www.sbnation.com',\n\n title: {\n selectors: ['h1.c-page-title']\n },\n\n author: {\n selectors: [['meta[name=\"author\"]', 'value']]\n },\n\n date_published: {\n selectors: [['meta[name=\"article:published_time\"]', 'value']]\n },\n\n dek: {\n selectors: ['h2.c-entry-summary.p-dek']\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['div.c-entry-content'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n }\n};\n\nvar WwwBloombergComExtractor = {\n domain: 'www.bloomberg.com',\n\n title: {\n selectors: [\n // normal articles\n '.lede-headline',\n\n // /graphics/ template\n 'h1.article-title',\n\n // /news/ template\n 'h1.lede-text-only__hed']\n },\n\n author: {\n selectors: [['meta[name=\"parsely-author\"]', 'value'], '.byline-details__link',\n\n // /graphics/ template\n '.bydek',\n\n // /news/ template\n '.author']\n },\n\n date_published: {\n selectors: [['time.published-at', 'datetime'], ['time[datetime]', 'datetime'], ['meta[name=\"date\"]', 'value'], ['meta[name=\"parsely-pub-date\"]', 'value']]\n },\n\n dek: {\n selectors: []\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['.article-body__content',\n\n // /graphics/ template\n ['section.copy-block'],\n\n // /news/ template\n '.body-copy'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['.inline-newsletter', '.page-ad']\n }\n};\n\nvar WwwBustleComExtractor = {\n domain: 'www.bustle.com',\n\n title: {\n selectors: ['h1.post-page__title']\n },\n\n author: {\n selectors: ['div.content-meta__author']\n },\n\n date_published: {\n selectors: [['time.content-meta__published-date[datetime]', 'datetime']]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['.post-page__body'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n }\n};\n\nvar WwwNprOrgExtractor = {\n domain: 'www.npr.org',\n\n title: {\n selectors: ['h1', '.storytitle']\n },\n\n author: {\n selectors: ['p.byline__name.byline__name--block']\n },\n\n date_published: {\n selectors: [['.dateblock time[datetime]', 'datetime'], ['meta[name=\"date\"]', 'value']]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value'], ['meta[name=\"twitter:image:src\"]', 'value']]\n },\n\n content: {\n selectors: ['.storytext'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {\n '.bucketwrap.image': 'figure',\n '.bucketwrap.image .credit-caption': 'figcaption'\n },\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['div.enlarge_measure']\n }\n};\n\nvar WwwRecodeNetExtractor = {\n domain: 'www.recode.net',\n\n title: {\n selectors: ['h1.c-page-title']\n },\n\n author: {\n selectors: [['meta[name=\"author\"]', 'value']]\n },\n\n date_published: {\n selectors: [['meta[name=\"article:published_time\"]', 'value']]\n },\n\n dek: {\n selectors: ['h2.c-entry-summary.p-dek']\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: [['figure.e-image--hero', '.c-entry-content'], '.c-entry-content'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n }\n};\n\nvar QzComExtractor = {\n domain: 'qz.com',\n\n title: {\n selectors: ['header.item-header.content-width-responsive']\n },\n\n author: {\n selectors: [['meta[name=\"author\"]', 'value']]\n },\n\n date_published: {\n selectors: ['.timestamp']\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: [['figure.featured-image', '.item-body'], '.item-body'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['.article-aside', '.progressive-image-thumbnail']\n }\n};\n\nvar WwwDmagazineComExtractor = {\n domain: 'www.dmagazine.com',\n\n title: {\n selectors: ['h1.story__title']\n },\n\n author: {\n selectors: ['.story__info .story__info__item:first-child']\n },\n\n date_published: {\n selectors: [\n // enter selectors\n '.story__info'],\n\n timezone: 'America/Chicago'\n },\n\n dek: {\n selectors: ['.story__subhead']\n },\n\n lead_image_url: {\n selectors: [['article figure a:first-child', 'href']]\n },\n\n content: {\n selectors: ['.story__content'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n }\n};\n\nvar WwwReutersComExtractor = {\n domain: 'www.reuters.com',\n\n title: {\n selectors: ['h1.article-headline']\n },\n\n author: {\n selectors: ['.author']\n },\n\n date_published: {\n selectors: [['meta[name=\"og:article:published_time\"]', 'value']]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['#article-text'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {\n '.article-subtitle': 'h4'\n },\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['#article-byline .author']\n }\n};\n\nvar MashableComExtractor = {\n domain: 'mashable.com',\n\n title: {\n selectors: ['h1.title']\n },\n\n author: {\n selectors: ['span.author_name a']\n },\n\n date_published: {\n selectors: [['meta[name=\"og:article:published_time\"]', 'value']]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['section.article-content.blueprint'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {\n '.image-credit': 'figcaption'\n },\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n }\n};\n\nvar WwwChicagotribuneComExtractor = {\n domain: 'www.chicagotribune.com',\n\n title: {\n selectors: ['h1.trb_ar_hl_t']\n },\n\n author: {\n selectors: ['span.trb_ar_by_nm_au']\n },\n\n date_published: {\n selectors: [['meta[itemprop=\"datePublished\"]', 'value']]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['div.trb_ar_page'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n }\n};\n\nvar WwwVoxComExtractor = {\n domain: 'www.vox.com',\n\n title: {\n selectors: ['h1.c-page-title']\n },\n\n author: {\n selectors: [['meta[name=\"author\"]', 'value']]\n },\n\n date_published: {\n selectors: [['meta[name=\"article:published_time\"]', 'value']]\n },\n\n dek: {\n selectors: ['.p-dek']\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: [['figure.e-image--hero', '.c-entry-content'], '.c-entry-content'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {\n 'figure .e-image__image noscript': function figureEImage__imageNoscript($node) {\n var imgHtml = $node.html();\n $node.parents('.e-image__image').find('.c-dynamic-image').replaceWith(imgHtml);\n },\n\n 'figure .e-image__meta': 'figcaption'\n },\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n }\n};\n\nvar NewsNationalgeographicComExtractor = {\n domain: 'news.nationalgeographic.com',\n\n title: {\n selectors: ['h1', 'h1.main-title']\n },\n\n author: {\n selectors: ['.byline-component__contributors b span']\n },\n\n date_published: {\n selectors: [['meta[name=\"article:published_time\"]', 'value']],\n format: 'ddd MMM DD HH:mm:ss zz YYYY',\n timezone: 'EST'\n },\n\n dek: {\n selectors: ['.article__deck']\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: [['.parsys.content', '.__image-lead__'], '.content'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {\n '.parsys.content': function parsysContent($node, $) {\n var $imgSrc = $node.find('.image.parbase.section').find('.picturefill').first().data('platform-src');\n if ($imgSrc) {\n $node.prepend($('<img class=\"__image-lead__\" src=\"' + $imgSrc + '\"/>'));\n }\n }\n },\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['.pull-quote.pull-quote--large']\n }\n};\n\nvar WwwNationalgeographicComExtractor = {\n domain: 'www.nationalgeographic.com',\n\n title: {\n selectors: ['h1', 'h1.main-title']\n },\n\n author: {\n selectors: ['.byline-component__contributors b span']\n },\n\n date_published: {\n selectors: [['meta[name=\"article:published_time\"]', 'value']]\n },\n\n dek: {\n selectors: ['.article__deck']\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: [['.parsys.content', '.__image-lead__'], '.content'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {\n '.parsys.content': function parsysContent($node, $) {\n var $imageParent = $node.children().first();\n if ($imageParent.hasClass('imageGroup')) {\n var $dataAttrContainer = $imageParent.find('.media--medium__container').children().first();\n var imgPath1 = $dataAttrContainer.data('platform-image1-path');\n var imgPath2 = $dataAttrContainer.data('platform-image2-path');\n if (imgPath2 && imgPath1) {\n $node.prepend($('<div class=\"__image-lead__\">\\n <img src=\"' + imgPath1 + '\"/>\\n <img src=\"' + imgPath2 + '\"/>\\n </div>'));\n }\n } else {\n var $imgSrc = $node.find('.image.parbase.section').find('.picturefill').first().data('platform-src');\n if ($imgSrc) {\n $node.prepend($('<img class=\"__image-lead__\" src=\"' + $imgSrc + '\"/>'));\n }\n }\n }\n },\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['.pull-quote.pull-quote--small']\n }\n};\n\nvar WwwLatimesComExtractor = {\n domain: 'www.latimes.com',\n\n title: {\n selectors: ['.trb_ar_hl']\n },\n\n author: {\n selectors: [['meta[name=\"author\"]', 'value']]\n },\n\n date_published: {\n selectors: [['meta[itemprop=\"datePublished\"]', 'value']]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['.trb_ar_main'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {\n '.trb_ar_la': function trb_ar_la($node) {\n var $figure = $node.find('figure');\n $node.replaceWith($figure);\n }\n },\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['.trb_ar_by', '.trb_ar_cr']\n }\n};\n\nvar PagesixComExtractor = {\n domain: 'pagesix.com',\n\n supportedDomains: ['nypost.com'],\n\n title: {\n selectors: ['h1 a']\n },\n\n author: {\n selectors: ['.byline']\n },\n\n date_published: {\n selectors: [['meta[name=\"article:published_time\"]', 'value']]\n },\n\n dek: {\n selectors: [['meta[name=\"description\"]', 'value']]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: [['#featured-image-wrapper', '.entry-content'], '.entry-content'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {\n '#featured-image-wrapper': 'figure',\n '.wp-caption-text': 'figcaption'\n },\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['.modal-trigger']\n }\n};\n\nvar ThefederalistpapersOrgExtractor = {\n domain: 'thefederalistpapers.org',\n\n title: {\n selectors: ['h1.entry-title']\n },\n\n author: {\n selectors: ['main span.entry-author-name']\n },\n\n date_published: {\n selectors: [['meta[name=\"article:published_time\"]', 'value']]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['.entry-content'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: [['p[style]']]\n }\n};\n\nvar WwwCbssportsComExtractor = {\n domain: 'www.cbssports.com',\n\n title: {\n selectors: ['.article-headline']\n },\n\n author: {\n selectors: ['.author-name']\n },\n\n date_published: {\n selectors: [['.date-original-reading-time time', 'datetime']],\n timezone: 'UTC'\n },\n\n dek: {\n selectors: ['.article-subline']\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['.article'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n }\n};\n\nvar WwwMsnbcComExtractor = {\n domain: 'www.msnbc.com',\n\n title: {\n selectors: ['h1', 'h1.is-title-pane']\n },\n\n author: {\n selectors: ['.author']\n },\n\n date_published: {\n selectors: [['meta[name=\"DC.date.issued\"]', 'value']]\n },\n\n dek: {\n selectors: [['meta[name=\"description\"]', 'value']]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['.pane-node-body'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {\n '.pane-node-body': function paneNodeBody($node, $) {\n var _WwwMsnbcComExtractor = _slicedToArray(WwwMsnbcComExtractor.lead_image_url.selectors[0], 2),\n selector = _WwwMsnbcComExtractor[0],\n attr = _WwwMsnbcComExtractor[1];\n\n var src = $(selector).attr(attr);\n if (src) {\n $node.prepend('<img src=\"' + src + '\" />');\n }\n }\n },\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n }\n};\n\nvar WwwThepoliticalinsiderComExtractor = {\n domain: 'www.thepoliticalinsider.com',\n\n title: {\n selectors: [['meta[name=\"sailthru.title\"]', 'value']]\n },\n\n author: {\n selectors: [['meta[name=\"sailthru.author\"]', 'value']]\n },\n\n date_published: {\n selectors: [['meta[name=\"sailthru.date\"]', 'value']],\n timezone: 'America/New_York'\n },\n\n dek: {\n selectors: [\n // enter selectors\n ]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['div#article-body'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n }\n};\n\nvar WwwMentalflossComExtractor = {\n domain: 'www.mentalfloss.com',\n\n title: {\n selectors: ['h1.title', '.title-group', '.inner']\n },\n\n author: {\n selectors: ['.field-name-field-enhanced-authors']\n },\n\n date_published: {\n selectors: ['.date-display-single'],\n timezone: 'America/New_York'\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['div.field.field-name-body'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n }\n};\n\nvar AbcnewsGoComExtractor = {\n domain: 'abcnews.go.com',\n\n title: {\n selectors: ['.article-header h1']\n },\n\n author: {\n selectors: ['.authors'],\n clean: ['.author-overlay', '.by-text']\n },\n\n date_published: {\n selectors: ['.timestamp'],\n timezone: 'America/New_York'\n\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['.article-copy'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n }\n};\n\nvar WwwNydailynewsComExtractor = {\n domain: 'www.nydailynews.com',\n\n title: {\n selectors: ['h1#ra-headline']\n },\n\n author: {\n selectors: [['meta[name=\"parsely-author\"]', 'value']]\n },\n\n date_published: {\n selectors: [['meta[name=\"sailthru.date\"]', 'value']]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['article#ra-body'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['dl#ra-tags', '.ra-related', 'a.ra-editor', 'dl#ra-share-bottom']\n }\n};\n\nvar WwwCnbcComExtractor = {\n domain: 'www.cnbc.com',\n\n title: {\n selectors: ['h1.title']\n },\n\n author: {\n selectors: [['meta[name=\"author\"]', 'value']]\n },\n\n date_published: {\n selectors: [['meta[name=\"article:published_time\"]', 'value']]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['div#article_body.content', 'div.story'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n }\n};\n\nvar WwwPopsugarComExtractor = {\n domain: 'www.popsugar.com',\n\n title: {\n selectors: ['h2.post-title', 'title-text']\n },\n\n author: {\n selectors: [['meta[name=\"article:author\"]', 'value']]\n },\n\n date_published: {\n selectors: [['meta[name=\"article:published_time\"]', 'value']]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['#content'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['.share-copy-title', '.post-tags', '.reactions']\n }\n};\n\nvar ObserverComExtractor = {\n domain: 'observer.com',\n\n title: {\n selectors: ['h1.entry-title']\n },\n\n author: {\n selectors: ['.author', '.vcard']\n },\n\n date_published: {\n selectors: [['meta[name=\"article:published_time\"]', 'value']]\n },\n\n dek: {\n selectors: ['h2.dek']\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['div.entry-content'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n }\n};\n\nvar PeopleComExtractor = {\n domain: 'people.com',\n\n title: {\n selectors: [['meta[name=\"og:title\"]', 'value']]\n },\n\n author: {\n selectors: ['a.author.url.fn']\n },\n\n date_published: {\n selectors: [['meta[name=\"article:published_time\"]', 'value']]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['div.article-body__inner'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n }\n};\n\nvar WwwUsmagazineComExtractor = {\n domain: 'www.usmagazine.com',\n\n title: {\n selectors: ['header h1']\n },\n\n author: {\n selectors: ['a.article-byline.tracked-offpage']\n },\n\n date_published: {\n timezone: 'America/New_York',\n\n selectors: ['time.article-published-date']\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['div.article-body-inner'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['.module-related']\n }\n};\n\nvar WwwRollingstoneComExtractor = {\n domain: 'www.rollingstone.com',\n\n title: {\n selectors: ['h1.content-title']\n },\n\n author: {\n selectors: ['a.content-author.tracked-offpage']\n },\n\n date_published: {\n selectors: ['time.content-published-date'],\n\n timezone: 'America/New_York'\n },\n\n dek: {\n selectors: ['.content-description']\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: [['.lead-container', '.article-content'], '.article-content'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['.module-related']\n }\n};\n\nvar twofortysevensportsComExtractor = {\n domain: '247sports.com',\n\n title: {\n selectors: ['title', 'article header h1']\n },\n\n author: {\n selectors: ['.author']\n },\n\n date_published: {\n selectors: [['time[data-published]', 'data-published']]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['section.body.article'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n }\n};\n\nvar UproxxComExtractor = {\n domain: 'uproxx.com',\n\n title: {\n selectors: ['div.post-top h1']\n },\n\n author: {\n selectors: ['.post-top .authorname']\n },\n\n date_published: {\n selectors: [['meta[name=\"article:published_time\"]', 'value']]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['.post-body'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {\n 'div.image': 'figure',\n 'div.image .wp-media-credit': 'figcaption'\n },\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n }\n};\n\nvar WwwEonlineComExtractor = {\n domain: 'www.eonline.com',\n\n title: {\n selectors: ['h1.article__title']\n },\n\n author: {\n selectors: ['.entry-meta__author a']\n },\n\n date_published: {\n selectors: [['meta[itemprop=\"datePublished\"]', 'value']]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: [['.post-content section, .post-content div.post-content__image']],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {\n 'div.post-content__image': 'figure',\n 'div.post-content__image .image__credits': 'figcaption'\n },\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n }\n};\n\nvar WwwMiamiheraldComExtractor = {\n domain: 'www.miamiherald.com',\n\n title: {\n selectors: ['h1.title']\n },\n\n date_published: {\n selectors: ['p.published-date'],\n\n timezone: 'America/New_York'\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['div.dateline-storybody'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n }\n};\n\nvar WwwRefinery29ComExtractor = {\n domain: 'www.refinery29.com',\n\n title: {\n selectors: ['h1.title']\n },\n\n author: {\n selectors: ['.contributor']\n },\n\n date_published: {\n selectors: [['meta[name=\"sailthru.date\"]', 'value']],\n\n timezone: 'America/New_York'\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: [['.full-width-opener', '.article-content'], '.article-content', '.body'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {\n 'div.loading noscript': function divLoadingNoscript($node) {\n var imgHtml = $node.html();\n $node.parents('.loading').replaceWith(imgHtml);\n },\n\n '.section-image': 'figure',\n\n '.section-image .content-caption': 'figcaption',\n\n '.section-text': 'p'\n },\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['.story-share']\n }\n};\n\nvar WwwMacrumorsComExtractor = {\n domain: 'www.macrumors.com',\n\n title: {\n selectors: ['h1', 'h1.title']\n },\n\n author: {\n selectors: ['.author-url']\n },\n\n date_published: {\n selectors: ['.article .byline'],\n\n // Wednesday January 18, 2017 11:44 am PST\n format: 'dddd MMMM D, YYYY h:mm A zz',\n\n timezone: 'America/Los_Angeles'\n },\n\n dek: {\n selectors: [['meta[name=\"description\"]', 'value']]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['.article'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n }\n};\n\nvar WwwAndroidcentralComExtractor = {\n domain: 'www.androidcentral.com',\n\n title: {\n selectors: ['h1', 'h1.main-title']\n },\n\n author: {\n selectors: ['.meta-by']\n },\n\n date_published: {\n selectors: [['meta[name=\"article:published_time\"]', 'value']]\n },\n\n dek: {\n selectors: [['meta[name=\"og:description\"]', 'value']]\n },\n\n lead_image_url: {\n selectors: [['.image-large', 'src']]\n },\n\n content: {\n selectors: ['.article-body'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['.intro', 'blockquote']\n }\n};\n\nvar WwwSiComExtractor = {\n domain: 'www.si.com',\n\n title: {\n selectors: ['h1', 'h1.headline']\n },\n\n author: {\n selectors: [['meta[name=\"author\"]', 'value']]\n },\n\n date_published: {\n selectors: ['.timestamp'],\n\n timezone: 'America/New_York'\n },\n\n dek: {\n selectors: ['.quick-hit ul']\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: [['p', '.marquee_large_2x', '.component.image']],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {\n\n noscript: function noscript($node) {\n var $children = $node.children();\n if ($children.length === 1 && $children.get(0).tagName === 'img') {\n return 'figure';\n }\n\n return null;\n }\n },\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: [['.inline-thumb', '.primary-message', '.description', '.instructions']]\n }\n};\n\nvar WwwRawstoryComExtractor = {\n domain: 'www.rawstory.com',\n\n title: {\n selectors: ['.blog-title']\n },\n\n author: {\n selectors: ['.blog-author a:first-of-type']\n },\n\n date_published: {\n selectors: ['.blog-author a:last-of-type'],\n\n timezone: 'EST'\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['.blog-content'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n }\n};\n\nvar WwwCnetComExtractor = {\n domain: 'www.cnet.com',\n\n title: {\n selectors: [['meta[name=\"og:title\"]', 'value']]\n },\n\n author: {\n selectors: ['a.author']\n },\n\n date_published: {\n selectors: ['time'],\n\n timezone: 'America/Los_Angeles'\n },\n\n dek: {\n selectors: ['.article-dek']\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: [['img.__image-lead__', '.article-main-body'], '.article-main-body'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {\n 'figure.image': function figureImage($node) {\n var $img = $node.find('img');\n $img.attr('width', '100%');\n $img.attr('height', '100%');\n $img.addClass('__image-lead__');\n $node.remove('.imgContainer').prepend($img);\n }\n },\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n }\n};\n\nvar WwwCinemablendComExtractor = {\n domain: 'www.cinemablend.com',\n\n title: {\n selectors: ['.story_title']\n },\n\n author: {\n selectors: ['.author']\n },\n\n date_published: {\n selectors: [['meta[name=\"article:published_time\"]', 'value']],\n\n timezone: 'EST'\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['div#wrap_left_content'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n }\n};\n\nvar WwwTodayComExtractor = {\n domain: 'www.today.com',\n\n title: {\n selectors: ['h1.entry-headline']\n },\n\n author: {\n selectors: [['meta[name=\"author\"]', 'value']]\n },\n\n date_published: {\n selectors: [['meta[name=\"DC.date.issued\"]', 'value']]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['.entry-container'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['.label-comment']\n }\n};\n\nvar WwwHowtogeekComExtractor = {\n domain: 'www.howtogeek.com',\n\n title: {\n selectors: ['title']\n },\n\n author: {\n selectors: ['#authorinfobox a']\n },\n\n date_published: {\n selectors: ['#authorinfobox + div li'],\n timezone: 'GMT'\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['.thecontent'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n }\n};\n\nvar WwwAlComExtractor = {\n domain: 'www.al.com',\n\n title: {\n selectors: [['meta[name=\"title\"]', 'value']]\n },\n\n author: {\n selectors: [['meta[name=\"article_author\"]', 'value']]\n },\n\n date_published: {\n selectors: [['meta[name=\"article_date_original\"]', 'value']],\n timezone: 'EST'\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['.entry-content'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n }\n};\n\nvar WwwThepennyhoarderComExtractor = {\n domain: 'www.thepennyhoarder.com',\n\n title: {\n selectors: [['meta[name=\"dcterms.title\"]', 'value']]\n },\n\n author: {\n selectors: [['link[rel=\"author\"]', 'title']]\n },\n\n date_published: {\n selectors: [['meta[name=\"article:published_time\"]', 'value']]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: [['.post-img', '.post-text'], '.post-text'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n }\n};\n\nvar WwwWesternjournalismComExtractor = {\n domain: 'www.westernjournalism.com',\n\n title: {\n selectors: ['title', 'h1.entry-title']\n },\n\n author: {\n selectors: [['meta[name=\"author\"]', 'value']]\n },\n\n date_published: {\n selectors: [['meta[name=\"DC.date.issued\"]', 'value']]\n },\n\n dek: {\n selectors: ['.subtitle']\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['div.article-sharing.top + div'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['.ad-notice-small']\n }\n};\n\nvar FusionNetExtractor = {\n domain: 'fusion.net',\n\n title: {\n selectors: ['.post-title', '.single-title', '.headline']\n },\n\n author: {\n selectors: ['.show-for-medium .byline']\n },\n\n date_published: {\n selectors: [['time.local-time', 'datetime']]\n },\n\n dek: {\n selectors: [\n // enter selectors\n ]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: [['.post-featured-media', '.article-content'], '.article-content'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {\n '.fusion-youtube-oembed': 'figure'\n },\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n }\n};\n\nvar WwwAmericanowComExtractor = {\n domain: 'www.americanow.com',\n\n title: {\n selectors: ['.title', ['meta[name=\"title\"]', 'value']]\n },\n\n author: {\n selectors: ['.byline']\n },\n\n date_published: {\n selectors: [['meta[name=\"publish_date\"]', 'value']]\n },\n\n dek: {\n selectors: [\n // enter selectors\n ]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: [['.article-content', '.image', '.body'], '.body'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['.article-video-wrapper', '.show-for-small-only']\n }\n};\n\nvar ScienceflyComExtractor = {\n domain: 'sciencefly.com',\n\n title: {\n selectors: ['.entry-title', '.cb-entry-title', '.cb-single-title']\n },\n\n author: {\n selectors: ['div.cb-author', 'div.cb-author-title']\n },\n\n date_published: {\n selectors: [['meta[name=\"article:published_time\"]', 'value']]\n },\n\n dek: {\n selectors: [\n // enter selectors\n ]\n },\n\n lead_image_url: {\n selectors: [['div.theiaPostSlider_slides img', 'src']]\n },\n\n content: {\n selectors: ['div.theiaPostSlider_slides'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n }\n};\n\nvar HellogigglesComExtractor = {\n domain: 'hellogiggles.com',\n\n title: {\n selectors: ['.title']\n },\n\n author: {\n selectors: ['.author-link']\n },\n\n date_published: {\n selectors: [['meta[name=\"article:published_time\"]', 'value']]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['.entry-content'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n }\n};\n\nvar ThoughtcatalogComExtractor = {\n domain: 'thoughtcatalog.com',\n\n title: {\n selectors: ['h1.title', ['meta[name=\"og:title\"]', 'value']]\n },\n\n author: {\n selectors: ['div.col-xs-12.article_header div.writer-container.writer-container-inline.writer-no-avatar h4.writer-name', 'h1.writer-name']\n },\n\n date_published: {\n selectors: [['meta[name=\"article:published_time\"]', 'value']]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['.entry.post'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['.tc_mark']\n }\n};\n\nvar WwwNjComExtractor = {\n domain: 'www.nj.com',\n\n title: {\n selectors: [['meta[name=\"title\"]', 'value']]\n },\n\n author: {\n selectors: [['meta[name=\"article_author\"]', 'value']]\n },\n\n date_published: {\n selectors: [['meta[name=\"article_date_original\"]', 'value']],\n\n timezone: 'America/New_York'\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['.entry-content'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n }\n};\n\nvar WwwInquisitrComExtractor = {\n domain: 'www.inquisitr.com',\n\n title: {\n selectors: ['h1.entry-title.story--header--title']\n },\n\n author: {\n selectors: ['div.story--header--author']\n },\n\n date_published: {\n selectors: [['meta[name=\"datePublished\"]', 'value']]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['article.story', '.entry-content.'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['.post-category', '.story--header--socials', '.story--header--content']\n }\n};\n\nvar WwwNbcnewsComExtractor = {\n domain: 'www.nbcnews.com',\n\n title: {\n selectors: ['div.article-hed h1']\n },\n\n author: {\n selectors: ['span.byline_author']\n },\n\n date_published: {\n selectors: [['.flag_article-wrapper time.timestamp_article[datetime]', 'datetime'], '.flag_article-wrapper time'],\n\n timezone: 'America/New_York'\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['div.article-body'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n }\n};\n\nvar FortuneComExtractor = {\n domain: 'fortune.com',\n\n title: {\n selectors: ['h1']\n },\n\n author: {\n selectors: [['meta[name=\"author\"]', 'value']]\n },\n\n date_published: {\n selectors: ['.MblGHNMJ'],\n\n timezone: 'UTC'\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: [['picture', 'article.row'], 'article.row'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n }\n};\n\nvar WwwLinkedinComExtractor = {\n domain: 'www.linkedin.com',\n\n title: {\n selectors: ['.article-title', 'h1']\n },\n\n author: {\n selectors: [['meta[name=\"article:author\"]', 'value'], '.entity-name a[rel=author]']\n },\n\n date_published: {\n selectors: [['time[itemprop=\"datePublished\"]', 'datetime']],\n\n timezone: 'America/Los_Angeles'\n },\n\n dek: {\n selectors: [\n // enter selectors\n ]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: [['header figure', '.prose'], '.prose'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['.entity-image']\n }\n};\n\nvar ObamawhitehouseArchivesGovExtractor = {\n domain: 'obamawhitehouse.archives.gov',\n\n supportedDomains: ['whitehouse.gov'],\n\n title: {\n selectors: ['h1', '.pane-node-title']\n },\n\n author: {\n selectors: ['.blog-author-link', '.node-person-name-link']\n },\n\n date_published: {\n selectors: [['meta[name=\"article:published_time\"]', 'value']]\n },\n\n dek: {\n selectors: ['.field-name-field-forall-summary']\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n defaultCleaner: false,\n\n selectors: ['div#content-start', '.pane-node-field-forall-body'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['.pane-node-title', '.pane-custom.pane-1']\n }\n};\n\nvar WwwOpposingviewsComExtractor = {\n domain: 'www.opposingviews.com',\n\n title: {\n selectors: ['h1.title']\n },\n\n author: {\n selectors: ['div.date span span a']\n },\n\n date_published: {\n selectors: [['meta[name=\"publish_date\"]', 'value']]\n },\n\n dek: {\n selectors: [\n // enter selectors\n ]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['.article-content'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['.show-for-small-only']\n }\n};\n\nvar WwwProspectmagazineCoUkExtractor = {\n domain: 'www.prospectmagazine.co.uk',\n\n title: {\n selectors: ['.page-title']\n },\n\n author: {\n selectors: ['.aside_author .title']\n },\n\n date_published: {\n selectors: ['.post-info'],\n\n timezone: 'Europe/London'\n },\n\n dek: {\n selectors: ['.page-subtitle']\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: [\n // ['article.type-post div.post_content p'],\n 'article .post_content'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n }\n};\n\nvar ForwardComExtractor = {\n domain: 'forward.com',\n\n title: {\n selectors: [['meta[name=\"og:title\"]', 'value']]\n },\n\n author: {\n selectors: ['.author-name', ['meta[name=\"sailthru.author\"]', 'value']]\n },\n\n date_published: {\n selectors: [['meta[name=\"date\"]', 'value']]\n },\n\n dek: {\n selectors: [\n // enter selectors\n ]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: [['.post-item-media-wrap', '.post-item p']],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['.donate-box', '.message', '.subtitle']\n }\n};\n\nvar WwwQdailyComExtractor = {\n domain: 'www.qdaily.com',\n\n title: {\n selectors: ['h2', 'h2.title']\n },\n\n author: {\n selectors: ['.name']\n },\n\n date_published: {\n selectors: [['.date.smart-date', 'data-origindate']]\n },\n\n dek: {\n selectors: ['.excerpt']\n },\n\n lead_image_url: {\n selectors: [['.article-detail-hd img', 'src']]\n },\n\n content: {\n selectors: ['.detail'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['.lazyload', '.lazylad', '.lazylood']\n }\n};\n\nvar GothamistComExtractor = {\n domain: 'gothamist.com',\n\n supportedDomains: ['chicagoist.com', 'laist.com', 'sfist.com', 'shanghaiist.com', 'dcist.com'],\n\n title: {\n selectors: ['h1', '.entry-header h1']\n },\n\n author: {\n selectors: ['.author']\n },\n\n date_published: {\n selectors: ['abbr', 'abbr.published'],\n\n timezone: 'America/New_York'\n },\n\n dek: {\n selectors: [null]\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['.entry-body'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {\n 'div.image-none': 'figure',\n '.image-none i': 'figcaption',\n 'div.image-left': 'figure',\n '.image-left i': 'figcaption',\n 'div.image-right': 'figure',\n '.image-right i': 'figcaption'\n },\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['.image-none br', '.image-left br', '.image-right br', '.galleryEase']\n }\n};\n\nvar WwwFoolComExtractor = {\n domain: 'www.fool.com',\n\n title: {\n selectors: ['h1']\n },\n\n author: {\n selectors: ['.author-inline .author-name']\n },\n\n date_published: {\n selectors: [['meta[name=\"date\"]', 'value']]\n },\n\n dek: {\n selectors: ['header h2']\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['.article-content'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {\n '.caption img': function captionImg($node) {\n var src = $node.attr('src');\n $node.parent().replaceWith('<figure><img src=\"' + src + '\"/></figure>');\n },\n '.caption': 'figcaption'\n },\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['#pitch']\n }\n};\n\nvar WwwSlateComExtractor = {\n domain: 'www.slate.com',\n\n title: {\n selectors: ['.hed', 'h1']\n },\n\n author: {\n selectors: ['a[rel=author]']\n },\n\n date_published: {\n selectors: ['.pub-date'],\n\n timezone: 'America/New_York'\n },\n\n dek: {\n selectors: ['.dek']\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: ['.body'],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: ['.about-the-author', '.pullquote', '.newsletter-signup-component', '.top-comment']\n }\n};\n\nvar IciRadioCanadaCaExtractor = {\n domain: 'ici.radio-canada.ca',\n\n title: {\n selectors: ['h1']\n },\n\n author: {\n selectors: [['meta[name=\"dc.creator\"]', 'value']]\n },\n\n date_published: {\n selectors: [['meta[name=\"dc.date.created\"]', 'value']],\n\n timezone: 'America/New_York'\n },\n\n dek: {\n selectors: ['.bunker-component.lead']\n },\n\n lead_image_url: {\n selectors: [['meta[name=\"og:image\"]', 'value']]\n },\n\n content: {\n selectors: [['.main-multimedia-item', '.news-story-content']],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {},\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: []\n }\n};\n\n\n\nvar CustomExtractors = Object.freeze({\n\tBloggerExtractor: BloggerExtractor,\n\tNYMagExtractor: NYMagExtractor,\n\tWikipediaExtractor: WikipediaExtractor,\n\tTwitterExtractor: TwitterExtractor,\n\tNYTimesExtractor: NYTimesExtractor,\n\tTheAtlanticExtractor: TheAtlanticExtractor,\n\tNewYorkerExtractor: NewYorkerExtractor,\n\tWiredExtractor: WiredExtractor,\n\tMSNExtractor: MSNExtractor,\n\tYahooExtractor: YahooExtractor,\n\tBuzzfeedExtractor: BuzzfeedExtractor,\n\tWikiaExtractor: WikiaExtractor,\n\tLittleThingsExtractor: LittleThingsExtractor,\n\tPoliticoExtractor: PoliticoExtractor,\n\tDeadspinExtractor: DeadspinExtractor,\n\tBroadwayWorldExtractor: BroadwayWorldExtractor,\n\tApartmentTherapyExtractor: ApartmentTherapyExtractor,\n\tMediumExtractor: MediumExtractor,\n\tWwwTmzComExtractor: WwwTmzComExtractor,\n\tWwwWashingtonpostComExtractor: WwwWashingtonpostComExtractor,\n\tWwwHuffingtonpostComExtractor: WwwHuffingtonpostComExtractor,\n\tNewrepublicComExtractor: NewrepublicComExtractor,\n\tMoneyCnnComExtractor: MoneyCnnComExtractor,\n\tWwwThevergeComExtractor: WwwThevergeComExtractor,\n\tWwwCnnComExtractor: WwwCnnComExtractor,\n\tWwwAolComExtractor: WwwAolComExtractor,\n\tWwwYoutubeComExtractor: WwwYoutubeComExtractor,\n\tWwwTheguardianComExtractor: WwwTheguardianComExtractor,\n\tWwwSbnationComExtractor: WwwSbnationComExtractor,\n\tWwwBloombergComExtractor: WwwBloombergComExtractor,\n\tWwwBustleComExtractor: WwwBustleComExtractor,\n\tWwwNprOrgExtractor: WwwNprOrgExtractor,\n\tWwwRecodeNetExtractor: WwwRecodeNetExtractor,\n\tQzComExtractor: QzComExtractor,\n\tWwwDmagazineComExtractor: WwwDmagazineComExtractor,\n\tWwwReutersComExtractor: WwwReutersComExtractor,\n\tMashableComExtractor: MashableComExtractor,\n\tWwwChicagotribuneComExtractor: WwwChicagotribuneComExtractor,\n\tWwwVoxComExtractor: WwwVoxComExtractor,\n\tNewsNationalgeographicComExtractor: NewsNationalgeographicComExtractor,\n\tWwwNationalgeographicComExtractor: WwwNationalgeographicComExtractor,\n\tWwwLatimesComExtractor: WwwLatimesComExtractor,\n\tPagesixComExtractor: PagesixComExtractor,\n\tThefederalistpapersOrgExtractor: ThefederalistpapersOrgExtractor,\n\tWwwCbssportsComExtractor: WwwCbssportsComExtractor,\n\tWwwMsnbcComExtractor: WwwMsnbcComExtractor,\n\tWwwThepoliticalinsiderComExtractor: WwwThepoliticalinsiderComExtractor,\n\tWwwMentalflossComExtractor: WwwMentalflossComExtractor,\n\tAbcnewsGoComExtractor: AbcnewsGoComExtractor,\n\tWwwNydailynewsComExtractor: WwwNydailynewsComExtractor,\n\tWwwCnbcComExtractor: WwwCnbcComExtractor,\n\tWwwPopsugarComExtractor: WwwPopsugarComExtractor,\n\tObserverComExtractor: ObserverComExtractor,\n\tPeopleComExtractor: PeopleComExtractor,\n\tWwwUsmagazineComExtractor: WwwUsmagazineComExtractor,\n\tWwwRollingstoneComExtractor: WwwRollingstoneComExtractor,\n\ttwofortysevensportsComExtractor: twofortysevensportsComExtractor,\n\tUproxxComExtractor: UproxxComExtractor,\n\tWwwEonlineComExtractor: WwwEonlineComExtractor,\n\tWwwMiamiheraldComExtractor: WwwMiamiheraldComExtractor,\n\tWwwRefinery29ComExtractor: WwwRefinery29ComExtractor,\n\tWwwMacrumorsComExtractor: WwwMacrumorsComExtractor,\n\tWwwAndroidcentralComExtractor: WwwAndroidcentralComExtractor,\n\tWwwSiComExtractor: WwwSiComExtractor,\n\tWwwRawstoryComExtractor: WwwRawstoryComExtractor,\n\tWwwCnetComExtractor: WwwCnetComExtractor,\n\tWwwCinemablendComExtractor: WwwCinemablendComExtractor,\n\tWwwTodayComExtractor: WwwTodayComExtractor,\n\tWwwHowtogeekComExtractor: WwwHowtogeekComExtractor,\n\tWwwAlComExtractor: WwwAlComExtractor,\n\tWwwThepennyhoarderComExtractor: WwwThepennyhoarderComExtractor,\n\tWwwWesternjournalismComExtractor: WwwWesternjournalismComExtractor,\n\tFusionNetExtractor: FusionNetExtractor,\n\tWwwAmericanowComExtractor: WwwAmericanowComExtractor,\n\tScienceflyComExtractor: ScienceflyComExtractor,\n\tHellogigglesComExtractor: HellogigglesComExtractor,\n\tThoughtcatalogComExtractor: ThoughtcatalogComExtractor,\n\tWwwNjComExtractor: WwwNjComExtractor,\n\tWwwInquisitrComExtractor: WwwInquisitrComExtractor,\n\tWwwNbcnewsComExtractor: WwwNbcnewsComExtractor,\n\tFortuneComExtractor: FortuneComExtractor,\n\tWwwLinkedinComExtractor: WwwLinkedinComExtractor,\n\tObamawhitehouseArchivesGovExtractor: ObamawhitehouseArchivesGovExtractor,\n\tWwwOpposingviewsComExtractor: WwwOpposingviewsComExtractor,\n\tWwwProspectmagazineCoUkExtractor: WwwProspectmagazineCoUkExtractor,\n\tForwardComExtractor: ForwardComExtractor,\n\tWwwQdailyComExtractor: WwwQdailyComExtractor,\n\tGothamistComExtractor: GothamistComExtractor,\n\tWwwFoolComExtractor: WwwFoolComExtractor,\n\tWwwSlateComExtractor: WwwSlateComExtractor,\n\tIciRadioCanadaCaExtractor: IciRadioCanadaCaExtractor\n});\n\nvar Extractors = _Object$keys(CustomExtractors).reduce(function (acc, key) {\n var extractor = CustomExtractors[key];\n return _extends({}, acc, mergeSupportedDomains(extractor));\n}, {});\n\n// CLEAN AUTHOR CONSTANTS\nvar CLEAN_AUTHOR_RE = /^\\s*(posted |written )?by\\s*:?\\s*(.*)/i;\n// author = re.sub(r'^\\s*(posted |written )?by\\s*:?\\s*(.*)(?i)',\n\n// CLEAN DEK CONSTANTS\nvar TEXT_LINK_RE = new RegExp('http(s)?://', 'i');\n// An ordered list of meta tag names that denote likely article deks.\n// From most distinct to least distinct.\n//\n// NOTE: There are currently no meta tags that seem to provide the right\n// content consistenty enough. Two options were:\n// - og:description\n// - dc.description\n// However, these tags often have SEO-specific junk in them that's not\n// header-worthy like a dek is. Excerpt material at best.\n\n\n// An ordered list of Selectors to find likely article deks. From\n// most explicit to least explicit.\n//\n// Should be more restrictive than not, as a failed dek can be pretty\n// detrimental to the aesthetics of an article.\n\n\n// CLEAN DATE PUBLISHED CONSTANTS\nvar MS_DATE_STRING = /^\\d{13}$/i;\nvar SEC_DATE_STRING = /^\\d{10}$/i;\nvar CLEAN_DATE_STRING_RE = /^\\s*published\\s*:?\\s*(.*)/i;\nvar TIME_MERIDIAN_SPACE_RE = /(.*\\d)(am|pm)(.*)/i;\nvar TIME_MERIDIAN_DOTS_RE = /\\.m\\./i;\nvar months = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];\nvar allMonths = months.join('|');\nvar timestamp1 = '[0-9]{1,2}:[0-9]{2,2}( ?[ap].?m.?)?';\nvar timestamp2 = '[0-9]{1,2}[/-][0-9]{1,2}[/-][0-9]{2,4}';\nvar timestamp3 = '-[0-9]{3,4}$';\nvar SPLIT_DATE_STRING = new RegExp('(' + timestamp1 + ')|(' + timestamp2 + ')|(' + timestamp3 + ')|([0-9]{1,4})|(' + allMonths + ')', 'ig');\n\n// 2016-11-22T08:57-500\n// Check if datetime string has an offset at the end\nvar TIME_WITH_OFFSET_RE = /-\\d{3,4}$/;\n\n// CLEAN TITLE CONSTANTS\n// A regular expression that will match separating characters on a\n// title, that usually denote breadcrumbs or something similar.\nvar TITLE_SPLITTERS_RE = /(: | - | \\| )/g;\n\nvar DOMAIN_ENDINGS_RE = new RegExp('.com$|.net$|.org$|.co.uk$', 'g');\n\n// Take an author string (like 'By David Smith ') and clean it to\n// just the name(s): 'David Smith'.\nfunction cleanAuthor(author) {\n return normalizeSpaces(author.replace(CLEAN_AUTHOR_RE, '$2').trim());\n}\n\nfunction clean$1(leadImageUrl) {\n leadImageUrl = leadImageUrl.trim();\n if (validUrl.isWebUri(leadImageUrl)) {\n return leadImageUrl;\n }\n\n return null;\n}\n\n// Take a dek HTML fragment, and return the cleaned version of it.\n// Return None if the dek wasn't good enough.\nfunction cleanDek(dek, _ref) {\n var $ = _ref.$,\n excerpt = _ref.excerpt;\n\n // Sanity check that we didn't get too short or long of a dek.\n if (dek.length > 1000 || dek.length < 5) return null;\n\n // Check that dek isn't the same as excerpt\n if (excerpt && excerptContent(excerpt, 10) === excerptContent(dek, 10)) return null;\n\n var dekText = stripTags(dek, $);\n\n // Plain text links shouldn't exist in the dek. If we have some, it's\n // not a good dek - bail.\n if (TEXT_LINK_RE.test(dekText)) return null;\n\n return normalizeSpaces(dekText.trim());\n}\n\n// Is there a compelling reason to use moment here?\n// Mostly only being used for the isValid() method,\n// but could just check for 'Invalid Date' string.\n\nfunction cleanDateString(dateString) {\n return (dateString.match(SPLIT_DATE_STRING) || []).join(' ').replace(TIME_MERIDIAN_DOTS_RE, 'm').replace(TIME_MERIDIAN_SPACE_RE, '$1 $2 $3').replace(CLEAN_DATE_STRING_RE, '$1').trim();\n}\n\nfunction createDate(dateString, timezone, format) {\n if (TIME_WITH_OFFSET_RE.test(dateString)) {\n return moment(new Date(dateString));\n }\n\n return timezone ? moment.tz(dateString, format || parseFormat(dateString), timezone) : moment(dateString, format || parseFormat(dateString));\n}\n\n// Take a date published string, and hopefully return a date out of\n// it. Return none if we fail.\nfunction cleanDatePublished(dateString) {\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n timezone = _ref.timezone,\n format = _ref.format;\n\n // If string is in milliseconds or seconds, convert to int and return\n if (MS_DATE_STRING.test(dateString) || SEC_DATE_STRING.test(dateString)) {\n return new Date(parseInt(dateString, 10)).toISOString();\n }\n\n var date = createDate(dateString, timezone, format);\n\n if (!date.isValid()) {\n dateString = cleanDateString(dateString);\n date = createDate(dateString, timezone, format);\n }\n\n return date.isValid() ? date.toISOString() : null;\n}\n\n// Clean our article content, returning a new, cleaned node.\nfunction extractCleanNode(article, _ref) {\n var $ = _ref.$,\n _ref$cleanConditional = _ref.cleanConditionally,\n cleanConditionally = _ref$cleanConditional === undefined ? true : _ref$cleanConditional,\n _ref$title = _ref.title,\n title = _ref$title === undefined ? '' : _ref$title,\n _ref$url = _ref.url,\n url = _ref$url === undefined ? '' : _ref$url,\n _ref$defaultCleaner = _ref.defaultCleaner,\n defaultCleaner = _ref$defaultCleaner === undefined ? true : _ref$defaultCleaner;\n\n // Rewrite the tag name to div if it's a top level node like body or\n // html to avoid later complications with multiple body tags.\n rewriteTopLevel$$1(article, $);\n\n // Drop small images and spacer images\n // Only do this is defaultCleaner is set to true;\n // this can sometimes be too aggressive.\n if (defaultCleaner) cleanImages(article, $);\n\n // Make links absolute\n makeLinksAbsolute$$1(article, $, url);\n\n // Mark elements to keep that would normally be removed.\n // E.g., stripJunkTags will remove iframes, so we're going to mark\n // YouTube/Vimeo videos as elements we want to keep.\n markToKeep(article, $, url);\n\n // Drop certain tags like <title>, etc\n // This is -mostly- for cleanliness, not security.\n stripJunkTags(article, $);\n\n // H1 tags are typically the article title, which should be extracted\n // by the title extractor instead. If there's less than 3 of them (<3),\n // strip them. Otherwise, turn 'em into H2s.\n cleanHOnes$$1(article, $);\n\n // Clean headers\n cleanHeaders(article, $, title);\n\n // We used to clean UL's and OL's here, but it was leading to\n // too many in-article lists being removed. Consider a better\n // way to detect menus particularly and remove them.\n // Also optionally running, since it can be overly aggressive.\n if (defaultCleaner) cleanTags$$1(article, $, cleanConditionally);\n\n // Remove empty paragraph nodes\n removeEmpty(article, $);\n\n // Remove unnecessary attributes\n cleanAttributes$$1(article, $);\n\n return article;\n}\n\nfunction cleanTitle$$1(title, _ref) {\n var url = _ref.url,\n $ = _ref.$;\n\n // If title has |, :, or - in it, see if\n // we can clean it up.\n if (TITLE_SPLITTERS_RE.test(title)) {\n title = resolveSplitTitle(title, url);\n }\n\n // Final sanity check that we didn't get a crazy title.\n // if (title.length > 150 || title.length < 15) {\n if (title.length > 150) {\n // If we did, return h1 from the document if it exists\n var h1 = $('h1');\n if (h1.length === 1) {\n title = h1.text();\n }\n }\n\n // strip any html tags in the title text\n return normalizeSpaces(stripTags(title, $).trim());\n}\n\nfunction extractBreadcrumbTitle(splitTitle, text) {\n // This must be a very breadcrumbed title, like:\n // The Best Gadgets on Earth : Bits : Blogs : NYTimes.com\n // NYTimes - Blogs - Bits - The Best Gadgets on Earth\n if (splitTitle.length >= 6) {\n var _ret = function () {\n // Look to see if we can find a breadcrumb splitter that happens\n // more than once. If we can, we'll be able to better pull out\n // the title.\n var termCounts = splitTitle.reduce(function (acc, titleText) {\n acc[titleText] = acc[titleText] ? acc[titleText] + 1 : 1;\n return acc;\n }, {});\n\n var _Reflect$ownKeys$redu = _Reflect$ownKeys(termCounts).reduce(function (acc, key) {\n if (acc[1] < termCounts[key]) {\n return [key, termCounts[key]];\n }\n\n return acc;\n }, [0, 0]),\n _Reflect$ownKeys$redu2 = _slicedToArray(_Reflect$ownKeys$redu, 2),\n maxTerm = _Reflect$ownKeys$redu2[0],\n termCount = _Reflect$ownKeys$redu2[1];\n\n // We found a splitter that was used more than once, so it\n // is probably the breadcrumber. Split our title on that instead.\n // Note: max_term should be <= 4 characters, so that \" >> \"\n // will match, but nothing longer than that.\n\n\n if (termCount >= 2 && maxTerm.length <= 4) {\n splitTitle = text.split(maxTerm);\n }\n\n var splitEnds = [splitTitle[0], splitTitle.slice(-1)];\n var longestEnd = splitEnds.reduce(function (acc, end) {\n return acc.length > end.length ? acc : end;\n }, '');\n\n if (longestEnd.length > 10) {\n return {\n v: longestEnd\n };\n }\n\n return {\n v: text\n };\n }();\n\n if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === \"object\") return _ret.v;\n }\n\n return null;\n}\n\nfunction cleanDomainFromTitle(splitTitle, url) {\n // Search the ends of the title, looking for bits that fuzzy match\n // the URL too closely. If one is found, discard it and return the\n // rest.\n //\n // Strip out the big TLDs - it just makes the matching a bit more\n // accurate. Not the end of the world if it doesn't strip right.\n var _URL$parse = URL.parse(url),\n host = _URL$parse.host;\n\n var nakedDomain = host.replace(DOMAIN_ENDINGS_RE, '');\n\n var startSlug = splitTitle[0].toLowerCase().replace(' ', '');\n var startSlugRatio = wuzzy.levenshtein(startSlug, nakedDomain);\n\n if (startSlugRatio > 0.4 && startSlug.length > 5) {\n return splitTitle.slice(2).join('');\n }\n\n var endSlug = splitTitle.slice(-1)[0].toLowerCase().replace(' ', '');\n var endSlugRatio = wuzzy.levenshtein(endSlug, nakedDomain);\n\n if (endSlugRatio > 0.4 && endSlug.length >= 5) {\n return splitTitle.slice(0, -2).join('');\n }\n\n return null;\n}\n\n// Given a title with separators in it (colons, dashes, etc),\n// resolve whether any of the segments should be removed.\nfunction resolveSplitTitle(title) {\n var url = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n // Splits while preserving splitters, like:\n // ['The New New York', ' - ', 'The Washington Post']\n var splitTitle = title.split(TITLE_SPLITTERS_RE);\n if (splitTitle.length === 1) {\n return title;\n }\n\n var newTitle = extractBreadcrumbTitle(splitTitle, title);\n if (newTitle) return newTitle;\n\n newTitle = cleanDomainFromTitle(splitTitle, url);\n if (newTitle) return newTitle;\n\n // Fuzzy ratio didn't find anything, so this title is probably legit.\n // Just return it all.\n return title;\n}\n\nvar Cleaners = {\n author: cleanAuthor,\n lead_image_url: clean$1,\n dek: cleanDek,\n date_published: cleanDatePublished,\n content: extractCleanNode,\n title: cleanTitle$$1\n};\n\n// Using a variety of scoring techniques, extract the content most\n// likely to be article text.\n//\n// If strip_unlikely_candidates is True, remove any elements that\n// match certain criteria first. (Like, does this element have a\n// classname of \"comment\")\n//\n// If weight_nodes is True, use classNames and IDs to determine the\n// worthiness of nodes.\n//\n// Returns a cheerio object $\nfunction extractBestNode($, opts) {\n // clone the node so we can get back to our\n // initial parsed state if needed\n // TODO Do I need this? AP\n // let $root = $.root().clone()\n\n if (opts.stripUnlikelyCandidates) {\n $ = stripUnlikelyCandidates($);\n }\n\n $ = convertToParagraphs$$1($);\n $ = scoreContent$$1($, opts.weightNodes);\n var $topCandidate = findTopCandidate$$1($);\n\n return $topCandidate;\n}\n\nvar GenericContentExtractor = {\n defaultOpts: {\n stripUnlikelyCandidates: true,\n weightNodes: true,\n cleanConditionally: true\n },\n\n // Extract the content for this resource - initially, pass in our\n // most restrictive opts which will return the highest quality\n // content. On each failure, retry with slightly more lax opts.\n //\n // :param return_type: string. If \"node\", should return the content\n // as a cheerio node rather than as an HTML string.\n //\n // Opts:\n // stripUnlikelyCandidates: Remove any elements that match\n // non-article-like criteria first.(Like, does this element\n // have a classname of \"comment\")\n //\n // weightNodes: Modify an elements score based on whether it has\n // certain classNames or IDs. Examples: Subtract if a node has\n // a className of 'comment', Add if a node has an ID of\n // 'entry-content'.\n //\n // cleanConditionally: Clean the node to return of some\n // superfluous content. Things like forms, ads, etc.\n extract: function extract(_ref, opts) {\n var $ = _ref.$,\n html = _ref.html,\n title = _ref.title,\n url = _ref.url;\n\n opts = _extends({}, this.defaultOpts, opts);\n\n $ = $ || cheerio.load(html);\n\n // Cascade through our extraction-specific opts in an ordered fashion,\n // turning them off as we try to extract content.\n var node = this.getContentNode($, title, url, opts);\n\n if (nodeIsSufficient(node)) {\n return this.cleanAndReturnNode(node, $);\n }\n\n // We didn't succeed on first pass, one by one disable our\n // extraction opts and try again.\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = _getIterator(_Reflect$ownKeys(opts).filter(function (k) {\n return opts[k] === true;\n })), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var key = _step.value;\n\n opts[key] = false;\n $ = cheerio.load(html);\n\n node = this.getContentNode($, title, url, opts);\n\n if (nodeIsSufficient(node)) {\n break;\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return this.cleanAndReturnNode(node, $);\n },\n\n\n // Get node given current options\n getContentNode: function getContentNode($, title, url, opts) {\n return extractCleanNode(extractBestNode($, opts), {\n $: $,\n cleanConditionally: opts.cleanConditionally,\n title: title,\n url: url\n });\n },\n\n\n // Once we got here, either we're at our last-resort node, or\n // we broke early. Make sure we at least have -something- before we\n // move forward.\n cleanAndReturnNode: function cleanAndReturnNode(node, $) {\n if (!node) {\n return null;\n }\n\n return normalizeSpaces($.html(node));\n\n // if return_type == \"html\":\n // return normalize_spaces(node_to_html(node))\n // else:\n // return node\n }\n};\n\n// TODO: It would be great if we could merge the meta and selector lists into\n// a list of objects, because we could then rank them better. For example,\n// .hentry .entry-title is far better suited than <meta title>.\n\n// An ordered list of meta tag names that denote likely article titles. All\n// attributes should be lowercase for faster case-insensitive matching. From\n// most distinct to least distinct.\nvar STRONG_TITLE_META_TAGS = ['tweetmeme-title', 'dc.title', 'rbtitle', 'headline', 'title'];\n\n// og:title is weak because it typically contains context that we don't like,\n// for example the source site's name. Gotta get that brand into facebook!\nvar WEAK_TITLE_META_TAGS = ['og:title'];\n\n// An ordered list of XPath Selectors to find likely article titles. From\n// most explicit to least explicit.\n//\n// Note - this does not use classes like CSS. This checks to see if the string\n// exists in the className, which is not as accurate as .className (which\n// splits on spaces/endlines), but for our purposes it's close enough. The\n// speed tradeoff is worth the accuracy hit.\nvar STRONG_TITLE_SELECTORS = ['.hentry .entry-title', 'h1#articleHeader', 'h1.articleHeader', 'h1.article', '.instapaper_title', '#meebo-title'];\n\nvar WEAK_TITLE_SELECTORS = ['article h1', '#entry-title', '.entry-title', '#entryTitle', '#entrytitle', '.entryTitle', '.entrytitle', '#articleTitle', '.articleTitle', 'post post-title', 'h1.title', 'h2.article', 'h1', 'html head title', 'title'];\n\nvar GenericTitleExtractor = {\n extract: function extract(_ref) {\n var $ = _ref.$,\n url = _ref.url,\n metaCache = _ref.metaCache;\n\n // First, check to see if we have a matching meta tag that we can make\n // use of that is strongly associated with the headline.\n var title = void 0;\n\n title = extractFromMeta$$1($, STRONG_TITLE_META_TAGS, metaCache);\n if (title) return cleanTitle$$1(title, { url: url, $: $ });\n\n // Second, look through our content selectors for the most likely\n // article title that is strongly associated with the headline.\n title = extractFromSelectors$$1($, STRONG_TITLE_SELECTORS);\n if (title) return cleanTitle$$1(title, { url: url, $: $ });\n\n // Third, check for weaker meta tags that may match.\n title = extractFromMeta$$1($, WEAK_TITLE_META_TAGS, metaCache);\n if (title) return cleanTitle$$1(title, { url: url, $: $ });\n\n // Last, look for weaker selector tags that may match.\n title = extractFromSelectors$$1($, WEAK_TITLE_SELECTORS);\n if (title) return cleanTitle$$1(title, { url: url, $: $ });\n\n // If no matches, return an empty string\n return '';\n }\n};\n\n// An ordered list of meta tag names that denote likely article authors. All\n// attributes should be lowercase for faster case-insensitive matching. From\n// most distinct to least distinct.\n//\n// Note: \"author\" is too often the -developer- of the page, so it is not\n// added here.\nvar AUTHOR_META_TAGS = ['byl', 'clmst', 'dc.author', 'dcsext.author', 'dc.creator', 'rbauthors', 'authors'];\n\nvar AUTHOR_MAX_LENGTH = 300;\n\n// An ordered list of XPath Selectors to find likely article authors. From\n// most explicit to least explicit.\n//\n// Note - this does not use classes like CSS. This checks to see if the string\n// exists in the className, which is not as accurate as .className (which\n// splits on spaces/endlines), but for our purposes it's close enough. The\n// speed tradeoff is worth the accuracy hit.\nvar AUTHOR_SELECTORS = ['.entry .entry-author', '.author.vcard .fn', '.author .vcard .fn', '.byline.vcard .fn', '.byline .vcard .fn', '.byline .by .author', '.byline .by', '.byline .author', '.post-author.vcard', '.post-author .vcard', 'a[rel=author]', '#by_author', '.by_author', '#entryAuthor', '.entryAuthor', '.byline a[href*=author]', '#author .authorname', '.author .authorname', '#author', '.author', '.articleauthor', '.ArticleAuthor', '.byline'];\n\n// An ordered list of Selectors to find likely article authors, with\n// regular expression for content.\nvar bylineRe = /^[\\n\\s]*By/i;\nvar BYLINE_SELECTORS_RE = [['#byline', bylineRe], ['.byline', bylineRe]];\n\nvar GenericAuthorExtractor = {\n extract: function extract(_ref) {\n var $ = _ref.$,\n metaCache = _ref.metaCache;\n\n var author = void 0;\n\n // First, check to see if we have a matching\n // meta tag that we can make use of.\n author = extractFromMeta$$1($, AUTHOR_META_TAGS, metaCache);\n if (author && author.length < AUTHOR_MAX_LENGTH) {\n return cleanAuthor(author);\n }\n\n // Second, look through our selectors looking for potential authors.\n author = extractFromSelectors$$1($, AUTHOR_SELECTORS, 2);\n if (author && author.length < AUTHOR_MAX_LENGTH) {\n return cleanAuthor(author);\n }\n\n // Last, use our looser regular-expression based selectors for\n // potential authors.\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = _getIterator(BYLINE_SELECTORS_RE), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var _ref4 = _step.value;\n\n var _ref3 = _slicedToArray(_ref4, 2);\n\n var selector = _ref3[0];\n var regex = _ref3[1];\n\n var node = $(selector);\n if (node.length === 1) {\n var text = node.text();\n if (regex.test(text)) {\n return cleanAuthor(text);\n }\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return null;\n }\n};\n\n// An ordered list of meta tag names that denote\n// likely date published dates. All attributes\n// should be lowercase for faster case-insensitive matching.\n// From most distinct to least distinct.\nvar DATE_PUBLISHED_META_TAGS = ['article:published_time', 'displaydate', 'dc.date', 'dc.date.issued', 'rbpubdate', 'publish_date', 'pub_date', 'pagedate', 'pubdate', 'revision_date', 'doc_date', 'date_created', 'content_create_date', 'lastmodified', 'created', 'date'];\n\n// An ordered list of XPath Selectors to find\n// likely date published dates. From most explicit\n// to least explicit.\nvar DATE_PUBLISHED_SELECTORS = ['.hentry .dtstamp.published', '.hentry .published', '.hentry .dtstamp.updated', '.hentry .updated', '.single .published', '.meta .published', '.meta .postDate', '.entry-date', '.byline .date', '.postmetadata .date', '.article_datetime', '.date-header', '.story-date', '.dateStamp', '#story .datetime', '.dateline', '.pubdate'];\n\n// An ordered list of compiled regular expressions to find likely date\n// published dates from the URL. These should always have the first\n// reference be a date string that is parseable by dateutil.parser.parse\nvar abbrevMonthsStr = '(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)';\nvar DATE_PUBLISHED_URL_RES = [\n// /2012/01/27/ but not /2012/01/293\nnew RegExp('/(20\\\\d{2}/\\\\d{2}/\\\\d{2})/', 'i'),\n// 20120127 or 20120127T but not 2012012733 or 8201201733\n// /[^0-9](20\\d{2}[01]\\d[0-3]\\d)([^0-9]|$)/i,\n// 2012-01-27\nnew RegExp('(20\\\\d{2}-[01]\\\\d-[0-3]\\\\d)', 'i'),\n// /2012/jan/27/\nnew RegExp('/(20\\\\d{2}/' + abbrevMonthsStr + '/[0-3]\\\\d)/', 'i')];\n\nvar GenericDatePublishedExtractor = {\n extract: function extract(_ref) {\n var $ = _ref.$,\n url = _ref.url,\n metaCache = _ref.metaCache;\n\n var datePublished = void 0;\n // First, check to see if we have a matching meta tag\n // that we can make use of.\n // Don't try cleaning tags from this string\n datePublished = extractFromMeta$$1($, DATE_PUBLISHED_META_TAGS, metaCache, false);\n if (datePublished) return cleanDatePublished(datePublished);\n\n // Second, look through our selectors looking for potential\n // date_published's.\n datePublished = extractFromSelectors$$1($, DATE_PUBLISHED_SELECTORS);\n if (datePublished) return cleanDatePublished(datePublished);\n\n // Lastly, look to see if a dately string exists in the URL\n datePublished = extractFromUrl(url, DATE_PUBLISHED_URL_RES);\n if (datePublished) return cleanDatePublished(datePublished);\n\n return null;\n }\n};\n\n// import {\n// DEK_META_TAGS,\n// DEK_SELECTORS,\n// DEK_URL_RES,\n// } from './constants';\n\n// import { cleanDek } from 'cleaners';\n\n// import {\n// extractFromMeta,\n// extractFromSelectors,\n// } from 'utils/dom';\n\n// Currently there is only one selector for\n// deks. We should simply return null here\n// until we have a more robust generic option.\n// Below is the original source for this, for reference.\nvar GenericDekExtractor = {\n // extract({ $, content, metaCache }) {\n extract: function extract() {\n return null;\n }\n};\n\n\n\n// def extract_dek(self):\n// # First, check to see if we have a matching meta tag that we can make\n// # use of.\n// dek = self.extract_from_meta('dek', constants.DEK_META_TAGS)\n// if not dek:\n// # Second, look through our CSS/XPath selectors. This may return\n// # an HTML fragment.\n// dek = self.extract_from_selectors('dek',\n// constants.DEK_SELECTORS,\n// text_only=False)\n//\n// if dek:\n// # Make sure our dek isn't in the first few thousand characters\n// # of the content, otherwise it's just the start of the article\n// # and not a true dek.\n// content = self.extract_content()\n// content_chunk = normalize_spaces(strip_tags(content[:2000]))\n// dek_chunk = normalize_spaces(dek[:100]) # Already has no tags.\n//\n// # 80% or greater similarity means the dek was very similar to some\n// # of the starting content, so we skip it.\n// if fuzz.partial_ratio(content_chunk, dek_chunk) < 80:\n// return dek\n//\n// return None\n\n// An ordered list of meta tag names that denote likely article leading images.\n// All attributes should be lowercase for faster case-insensitive matching.\n// From most distinct to least distinct.\nvar LEAD_IMAGE_URL_META_TAGS = ['og:image', 'twitter:image', 'image_src'];\n\nvar LEAD_IMAGE_URL_SELECTORS = ['link[rel=image_src]'];\n\nvar POSITIVE_LEAD_IMAGE_URL_HINTS = ['upload', 'wp-content', 'large', 'photo', 'wp-image'];\nvar POSITIVE_LEAD_IMAGE_URL_HINTS_RE = new RegExp(POSITIVE_LEAD_IMAGE_URL_HINTS.join('|'), 'i');\n\nvar NEGATIVE_LEAD_IMAGE_URL_HINTS = ['spacer', 'sprite', 'blank', 'throbber', 'gradient', 'tile', 'bg', 'background', 'icon', 'social', 'header', 'hdr', 'advert', 'spinner', 'loader', 'loading', 'default', 'rating', 'share', 'facebook', 'twitter', 'theme', 'promo', 'ads', 'wp-includes'];\nvar NEGATIVE_LEAD_IMAGE_URL_HINTS_RE = new RegExp(NEGATIVE_LEAD_IMAGE_URL_HINTS.join('|'), 'i');\n\nvar GIF_RE = /\\.gif(\\?.*)?$/i;\nvar JPG_RE = /\\.jpe?g(\\?.*)?$/i;\n\nfunction getSig($node) {\n return ($node.attr('class') || '') + ' ' + ($node.attr('id') || '');\n}\n\n// Scores image urls based on a variety of heuristics.\nfunction scoreImageUrl(url) {\n url = url.trim();\n var score = 0;\n\n if (POSITIVE_LEAD_IMAGE_URL_HINTS_RE.test(url)) {\n score += 20;\n }\n\n if (NEGATIVE_LEAD_IMAGE_URL_HINTS_RE.test(url)) {\n score -= 20;\n }\n\n // TODO: We might want to consider removing this as\n // gifs are much more common/popular than they once were\n if (GIF_RE.test(url)) {\n score -= 10;\n }\n\n if (JPG_RE.test(url)) {\n score += 10;\n }\n\n // PNGs are neutral.\n\n return score;\n}\n\n// Alt attribute usually means non-presentational image.\nfunction scoreAttr($img) {\n if ($img.attr('alt')) {\n return 5;\n }\n\n return 0;\n}\n\n// Look through our parent and grandparent for figure-like\n// container elements, give a bonus if we find them\nfunction scoreByParents($img) {\n var score = 0;\n var $figParent = $img.parents('figure').first();\n\n if ($figParent.length === 1) {\n score += 25;\n }\n\n var $parent = $img.parent();\n var $gParent = void 0;\n if ($parent.length === 1) {\n $gParent = $parent.parent();\n }\n\n [$parent, $gParent].forEach(function ($node) {\n if (PHOTO_HINTS_RE$1.test(getSig($node))) {\n score += 15;\n }\n });\n\n return score;\n}\n\n// Look at our immediate sibling and see if it looks like it's a\n// caption. Bonus if so.\nfunction scoreBySibling($img) {\n var score = 0;\n var $sibling = $img.next();\n var sibling = $sibling.get(0);\n\n if (sibling && sibling.tagName.toLowerCase() === 'figcaption') {\n score += 25;\n }\n\n if (PHOTO_HINTS_RE$1.test(getSig($sibling))) {\n score += 15;\n }\n\n return score;\n}\n\nfunction scoreByDimensions($img) {\n var score = 0;\n\n var width = parseFloat($img.attr('width'));\n var height = parseFloat($img.attr('height'));\n var src = $img.attr('src');\n\n // Penalty for skinny images\n if (width && width <= 50) {\n score -= 50;\n }\n\n // Penalty for short images\n if (height && height <= 50) {\n score -= 50;\n }\n\n if (width && height && !src.includes('sprite')) {\n var area = width * height;\n if (area < 5000) {\n // Smaller than 50 x 100\n score -= 100;\n } else {\n score += Math.round(area / 1000);\n }\n }\n\n return score;\n}\n\nfunction scoreByPosition($imgs, index) {\n return $imgs.length / 2 - index;\n}\n\n// Given a resource, try to find the lead image URL from within\n// it. Like content and next page extraction, uses a scoring system\n// to determine what the most likely image may be. Short circuits\n// on really probable things like og:image meta tags.\n//\n// Potential signals to still take advantage of:\n// * domain\n// * weird aspect ratio\nvar GenericLeadImageUrlExtractor = {\n extract: function extract(_ref) {\n var $ = _ref.$,\n content = _ref.content,\n metaCache = _ref.metaCache,\n html = _ref.html;\n\n var cleanUrl = void 0;\n if (!$.browser && $('head').length === 0) {\n $('*').first().prepend(html);\n }\n\n // Check to see if we have a matching meta tag that we can make use of.\n // Moving this higher because common practice is now to use large\n // images on things like Open Graph or Twitter cards.\n // images usually have for things like Open Graph.\n var imageUrl = extractFromMeta$$1($, LEAD_IMAGE_URL_META_TAGS, metaCache, false);\n\n if (imageUrl) {\n cleanUrl = clean$1(imageUrl);\n\n if (cleanUrl) return cleanUrl;\n }\n\n // Next, try to find the \"best\" image via the content.\n // We'd rather not have to fetch each image and check dimensions,\n // so try to do some analysis and determine them instead.\n var $content = $(content);\n var imgs = $('img', $content).toArray();\n var imgScores = {};\n\n imgs.forEach(function (img, index) {\n var $img = $(img);\n var src = $img.attr('src');\n\n if (!src) return;\n\n var score = scoreImageUrl(src);\n score += scoreAttr($img);\n score += scoreByParents($img);\n score += scoreBySibling($img);\n score += scoreByDimensions($img);\n score += scoreByPosition(imgs, index);\n\n imgScores[src] = score;\n });\n\n var _Reflect$ownKeys$redu = _Reflect$ownKeys(imgScores).reduce(function (acc, key) {\n return imgScores[key] > acc[1] ? [key, imgScores[key]] : acc;\n }, [null, 0]),\n _Reflect$ownKeys$redu2 = _slicedToArray(_Reflect$ownKeys$redu, 2),\n topUrl = _Reflect$ownKeys$redu2[0],\n topScore = _Reflect$ownKeys$redu2[1];\n\n if (topScore > 0) {\n cleanUrl = clean$1(topUrl);\n\n if (cleanUrl) return cleanUrl;\n }\n\n // If nothing else worked, check to see if there are any really\n // probable nodes in the doc, like <link rel=\"image_src\" />.\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = _getIterator(LEAD_IMAGE_URL_SELECTORS), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var selector = _step.value;\n\n var $node = $(selector).first();\n var src = $node.attr('src');\n if (src) {\n cleanUrl = clean$1(src);\n if (cleanUrl) return cleanUrl;\n }\n\n var href = $node.attr('href');\n if (href) {\n cleanUrl = clean$1(href);\n if (cleanUrl) return cleanUrl;\n }\n\n var value = $node.attr('value');\n if (value) {\n cleanUrl = clean$1(value);\n if (cleanUrl) return cleanUrl;\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return null;\n }\n};\n\n\n\n// def extract(self):\n// \"\"\"\n// # First, try to find the \"best\" image via the content.\n// # We'd rather not have to fetch each image and check dimensions,\n// # so try to do some analysis and determine them instead.\n// content = self.extractor.extract_content(return_type=\"node\")\n// imgs = content.xpath('.//img')\n// img_scores = defaultdict(int)\n// logger.debug('Scoring %d images from content', len(imgs))\n// for (i, img) in enumerate(imgs):\n// img_score = 0\n//\n// if not 'src' in img.attrib:\n// logger.debug('No src attribute found')\n// continue\n//\n// try:\n// parsed_img = urlparse(img.attrib['src'])\n// img_path = parsed_img.path.lower()\n// except ValueError:\n// logger.debug('ValueError getting img path.')\n// continue\n// logger.debug('Image path is %s', img_path)\n//\n// if constants.POSITIVE_LEAD_IMAGE_URL_HINTS_RE.match(img_path):\n// logger.debug('Positive URL hints match. Adding 20.')\n// img_score += 20\n//\n// if constants.NEGATIVE_LEAD_IMAGE_URL_HINTS_RE.match(img_path):\n// logger.debug('Negative URL hints match. Subtracting 20.')\n// img_score -= 20\n//\n// # Gifs are more often structure than photos\n// if img_path.endswith('gif'):\n// logger.debug('gif found. Subtracting 10.')\n// img_score -= 10\n//\n// # JPGs are more often photographs\n// if img_path.endswith('jpg'):\n// logger.debug('jpg found. Adding 10.')\n// img_score += 10\n//\n// # PNGs are neutral.\n//\n// # Alt attribute usually means non-presentational image.\n// if 'alt' in img.attrib and len(img.attrib['alt']) > 5:\n// logger.debug('alt attribute found. Adding 5.')\n// img_score += 5\n//\n// # Look through our parent and grandparent for figure-like\n// # container elements, give a bonus if we find them\n// parents = [img.getparent()]\n// if parents[0] is not None and parents[0].getparent() is not None:\n// parents.append(parents[0].getparent())\n// for p in parents:\n// if p.tag == 'figure':\n// logger.debug('Parent with <figure> tag found. Adding 25.')\n// img_score += 25\n//\n// p_sig = ' '.join([p.get('id', ''), p.get('class', '')])\n// if constants.PHOTO_HINTS_RE.search(p_sig):\n// logger.debug('Photo hints regex match. Adding 15.')\n// img_score += 15\n//\n// # Look at our immediate sibling and see if it looks like it's a\n// # caption. Bonus if so.\n// sibling = img.getnext()\n// if sibling is not None:\n// if sibling.tag == 'figcaption':\n// img_score += 25\n//\n// sib_sig = ' '.join([sibling.get('id', ''),\n// sibling.get('class', '')]).lower()\n// if 'caption' in sib_sig:\n// img_score += 15\n//\n// # Pull out width/height if they were set.\n// img_width = None\n// img_height = None\n// if 'width' in img.attrib:\n// try:\n// img_width = float(img.get('width'))\n// except ValueError:\n// pass\n// if 'height' in img.attrib:\n// try:\n// img_height = float(img.get('height'))\n// except ValueError:\n// pass\n//\n// # Penalty for skinny images\n// if img_width and img_width <= 50:\n// logger.debug('Skinny image found. Subtracting 50.')\n// img_score -= 50\n//\n// # Penalty for short images\n// if img_height and img_height <= 50:\n// # Wide, short images are more common than narrow, tall ones\n// logger.debug('Short image found. Subtracting 25.')\n// img_score -= 25\n//\n// if img_width and img_height and not 'sprite' in img_path:\n// area = img_width * img_height\n//\n// if area < 5000: # Smaller than 50x100\n// logger.debug('Image with small area found. Subtracting 100.')\n// img_score -= 100\n// else:\n// img_score += round(area/1000.0)\n//\n// # If the image is higher on the page than other images,\n// # it gets a bonus. Penalty if lower.\n// logger.debug('Adding page placement bonus of %d.', len(imgs)/2 - i)\n// img_score += len(imgs)/2 - i\n//\n// # Use the raw src here because we munged img_path for case\n// # insensitivity\n// logger.debug('Final score is %d.', img_score)\n// img_scores[img.attrib['src']] += img_score\n//\n// top_score = 0\n// top_url = None\n// for (url, score) in img_scores.items():\n// if score > top_score:\n// top_url = url\n// top_score = score\n//\n// if top_score > 0:\n// logger.debug('Using top score image from content. Score was %d', top_score)\n// return top_url\n//\n//\n// # If nothing else worked, check to see if there are any really\n// # probable nodes in the doc, like <link rel=\"image_src\" />.\n// logger.debug('Trying to find lead image in probable nodes')\n// for selector in constants.LEAD_IMAGE_URL_SELECTORS:\n// nodes = self.resource.extract_by_selector(selector)\n// for node in nodes:\n// clean_value = None\n// if node.attrib.get('src'):\n// clean_value = self.clean(node.attrib['src'])\n//\n// if not clean_value and node.attrib.get('href'):\n// clean_value = self.clean(node.attrib['href'])\n//\n// if not clean_value and node.attrib.get('value'):\n// clean_value = self.clean(node.attrib['value'])\n//\n// if clean_value:\n// logger.debug('Found lead image in probable nodes.')\n// logger.debug('Node was: %s', node)\n// return clean_value\n//\n// return None\n\nfunction scoreSimilarity(score, articleUrl, href) {\n // Do this last and only if we have a real candidate, because it's\n // potentially expensive computationally. Compare the link to this\n // URL using difflib to get the % similarity of these URLs. On a\n // sliding scale, subtract points from this link based on\n // similarity.\n if (score > 0) {\n var similarity = new difflib.SequenceMatcher(null, articleUrl, href).ratio();\n // Subtract .1 from diff_percent when calculating modifier,\n // which means that if it's less than 10% different, we give a\n // bonus instead. Ex:\n // 3% different = +17.5 points\n // 10% different = 0 points\n // 20% different = -25 points\n var diffPercent = 1.0 - similarity;\n var diffModifier = -(250 * (diffPercent - 0.2));\n return score + diffModifier;\n }\n\n return 0;\n}\n\nfunction scoreLinkText(linkText, pageNum) {\n // If the link text can be parsed as a number, give it a minor\n // bonus, with a slight bias towards lower numbered pages. This is\n // so that pages that might not have 'next' in their text can still\n // get scored, and sorted properly by score.\n var score = 0;\n\n if (IS_DIGIT_RE.test(linkText.trim())) {\n var linkTextAsNum = parseInt(linkText, 10);\n // If it's the first page, we already got it on the first call.\n // Give it a negative score. Otherwise, up to page 10, give a\n // small bonus.\n if (linkTextAsNum < 2) {\n score = -30;\n } else {\n score = Math.max(0, 10 - linkTextAsNum);\n }\n\n // If it appears that the current page number is greater than\n // this links page number, it's a very bad sign. Give it a big\n // penalty.\n if (pageNum && pageNum >= linkTextAsNum) {\n score -= 50;\n }\n }\n\n return score;\n}\n\nfunction scorePageInLink(pageNum, isWp) {\n // page in the link = bonus. Intentionally ignore wordpress because\n // their ?p=123 link style gets caught by this even though it means\n // separate documents entirely.\n if (pageNum && !isWp) {\n return 50;\n }\n\n return 0;\n}\n\nvar DIGIT_RE$2 = /\\d/;\n\n// A list of words that, if found in link text or URLs, likely mean that\n// this link is not a next page link.\nvar EXTRANEOUS_LINK_HINTS$1 = ['print', 'archive', 'comment', 'discuss', 'e-mail', 'email', 'share', 'reply', 'all', 'login', 'sign', 'single', 'adx', 'entry-unrelated'];\nvar EXTRANEOUS_LINK_HINTS_RE$1 = new RegExp(EXTRANEOUS_LINK_HINTS$1.join('|'), 'i');\n\n// Match any link text/classname/id that looks like it could mean the next\n// page. Things like: next, continue, >, >>, » but not >|, »| as those can\n// mean last page.\nvar NEXT_LINK_TEXT_RE$1 = new RegExp('(next|weiter|continue|>([^|]|$)|»([^|]|$))', 'i');\n\n// Match any link text/classname/id that looks like it is an end link: things\n// like \"first\", \"last\", \"end\", etc.\nvar CAP_LINK_TEXT_RE$1 = new RegExp('(first|last|end)', 'i');\n\n// Match any link text/classname/id that looks like it means the previous\n// page.\nvar PREV_LINK_TEXT_RE$1 = new RegExp('(prev|earl|old|new|<|«)', 'i');\n\n// Match any phrase that looks like it could be page, or paging, or pagination\n\nfunction scoreExtraneousLinks(href) {\n // If the URL itself contains extraneous values, give a penalty.\n if (EXTRANEOUS_LINK_HINTS_RE$1.test(href)) {\n return -25;\n }\n\n return 0;\n}\n\nfunction makeSig$1($link) {\n return ($link.attr('class') || '') + ' ' + ($link.attr('id') || '');\n}\n\nfunction scoreByParents$1($link) {\n // If a parent node contains paging-like classname or id, give a\n // bonus. Additionally, if a parent_node contains bad content\n // (like 'sponsor'), give a penalty.\n var $parent = $link.parent();\n var positiveMatch = false;\n var negativeMatch = false;\n var score = 0;\n\n _Array$from(range(0, 4)).forEach(function () {\n if ($parent.length === 0) {\n return;\n }\n\n var parentData = makeSig$1($parent, ' ');\n\n // If we have 'page' or 'paging' in our data, that's a good\n // sign. Add a bonus.\n if (!positiveMatch && PAGE_RE.test(parentData)) {\n positiveMatch = true;\n score += 25;\n }\n\n // If we have 'comment' or something in our data, and\n // we don't have something like 'content' as well, that's\n // a bad sign. Give a penalty.\n if (!negativeMatch && NEGATIVE_SCORE_RE.test(parentData) && EXTRANEOUS_LINK_HINTS_RE$1.test(parentData)) {\n if (!POSITIVE_SCORE_RE.test(parentData)) {\n negativeMatch = true;\n score -= 25;\n }\n }\n\n $parent = $parent.parent();\n });\n\n return score;\n}\n\nfunction scorePrevLink(linkData) {\n // If the link has something like \"previous\", its definitely\n // an old link, skip it.\n if (PREV_LINK_TEXT_RE$1.test(linkData)) {\n return -200;\n }\n\n return 0;\n}\n\nfunction shouldScore(href, articleUrl, baseUrl, parsedUrl, linkText, previousUrls) {\n // skip if we've already fetched this url\n if (previousUrls.find(function (url) {\n return href === url;\n }) !== undefined) {\n return false;\n }\n\n // If we've already parsed this URL, or the URL matches the base\n // URL, or is empty, skip it.\n if (!href || href === articleUrl || href === baseUrl) {\n return false;\n }\n\n var hostname = parsedUrl.hostname;\n\n var _URL$parse = URL.parse(href),\n linkHost = _URL$parse.hostname;\n\n // Domain mismatch.\n\n\n if (linkHost !== hostname) {\n return false;\n }\n\n // If href doesn't contain a digit after removing the base URL,\n // it's certainly not the next page.\n var fragment = href.replace(baseUrl, '');\n if (!DIGIT_RE$2.test(fragment)) {\n return false;\n }\n\n // This link has extraneous content (like \"comment\") in its link\n // text, so we skip it.\n if (EXTRANEOUS_LINK_HINTS_RE$1.test(linkText)) {\n return false;\n }\n\n // Next page link text is never long, skip if it is too long.\n if (linkText.length > 25) {\n return false;\n }\n\n return true;\n}\n\nfunction scoreBaseUrl(href, baseRegex) {\n // If the baseUrl isn't part of this URL, penalize this\n // link. It could still be the link, but the odds are lower.\n // Example:\n // http://www.actionscript.org/resources/articles/745/1/JavaScript-and-VBScript-Injection-in-ActionScript-3/Page1.html\n if (!baseRegex.test(href)) {\n return -25;\n }\n\n return 0;\n}\n\nfunction scoreNextLinkText(linkData) {\n // Things like \"next\", \">>\", etc.\n if (NEXT_LINK_TEXT_RE$1.test(linkData)) {\n return 50;\n }\n\n return 0;\n}\n\nfunction scoreCapLinks(linkData) {\n // Cap links are links like \"last\", etc.\n if (CAP_LINK_TEXT_RE$1.test(linkData)) {\n // If we found a link like \"last\", but we've already seen that\n // this link is also \"next\", it's fine. If it's not been\n // previously marked as \"next\", then it's probably bad.\n // Penalize.\n if (NEXT_LINK_TEXT_RE$1.test(linkData)) {\n return -65;\n }\n }\n\n return 0;\n}\n\nfunction makeBaseRegex(baseUrl) {\n return new RegExp('^' + baseUrl, 'i');\n}\n\nfunction makeSig($link, linkText) {\n return (linkText || $link.text()) + ' ' + ($link.attr('class') || '') + ' ' + ($link.attr('id') || '');\n}\n\nfunction scoreLinks(_ref) {\n var links = _ref.links,\n articleUrl = _ref.articleUrl,\n baseUrl = _ref.baseUrl,\n parsedUrl = _ref.parsedUrl,\n $ = _ref.$,\n _ref$previousUrls = _ref.previousUrls,\n previousUrls = _ref$previousUrls === undefined ? [] : _ref$previousUrls;\n\n parsedUrl = parsedUrl || URL.parse(articleUrl);\n var baseRegex = makeBaseRegex(baseUrl);\n var isWp = isWordpress($);\n\n // Loop through all links, looking for hints that they may be next-page\n // links. Things like having \"page\" in their textContent, className or\n // id, or being a child of a node with a page-y className or id.\n //\n // After we do that, assign each page a score, and pick the one that\n // looks most like the next page link, as long as its score is strong\n // enough to have decent confidence.\n var scoredPages = links.reduce(function (possiblePages, link) {\n // Remove any anchor data since we don't do a good job\n // standardizing URLs (it's hard), we're going to do\n // some checking with and without a trailing slash\n var attrs = getAttrs(link);\n\n // if href is undefined, return\n if (!attrs.href) return possiblePages;\n\n var href = removeAnchor(attrs.href);\n var $link = $(link);\n var linkText = $link.text();\n\n if (!shouldScore(href, articleUrl, baseUrl, parsedUrl, linkText, previousUrls)) {\n return possiblePages;\n }\n\n // ## PASSED THE FIRST-PASS TESTS. Start scoring. ##\n if (!possiblePages[href]) {\n possiblePages[href] = {\n score: 0,\n linkText: linkText,\n href: href\n };\n } else {\n possiblePages[href].linkText = possiblePages[href].linkText + '|' + linkText;\n }\n\n var possiblePage = possiblePages[href];\n var linkData = makeSig($link, linkText);\n var pageNum = pageNumFromUrl(href);\n\n var score = scoreBaseUrl(href, baseRegex);\n score += scoreNextLinkText(linkData);\n score += scoreCapLinks(linkData);\n score += scorePrevLink(linkData);\n score += scoreByParents$1($link);\n score += scoreExtraneousLinks(href);\n score += scorePageInLink(pageNum, isWp);\n score += scoreLinkText(linkText, pageNum);\n score += scoreSimilarity(score, articleUrl, href);\n\n possiblePage.score = score;\n\n return possiblePages;\n }, {});\n\n return _Reflect$ownKeys(scoredPages).length === 0 ? null : scoredPages;\n}\n\n// Looks for and returns next page url\n// for multi-page articles\nvar GenericNextPageUrlExtractor = {\n extract: function extract(_ref) {\n var $ = _ref.$,\n url = _ref.url,\n parsedUrl = _ref.parsedUrl,\n _ref$previousUrls = _ref.previousUrls,\n previousUrls = _ref$previousUrls === undefined ? [] : _ref$previousUrls;\n\n parsedUrl = parsedUrl || URL.parse(url);\n\n var articleUrl = removeAnchor(url);\n var baseUrl = articleBaseUrl(url, parsedUrl);\n\n var links = $('a[href]').toArray();\n\n var scoredLinks = scoreLinks({\n links: links,\n articleUrl: articleUrl,\n baseUrl: baseUrl,\n parsedUrl: parsedUrl,\n $: $,\n previousUrls: previousUrls\n });\n\n // If no links were scored, return null\n if (!scoredLinks) return null;\n\n // now that we've scored all possible pages,\n // find the biggest one.\n var topPage = _Reflect$ownKeys(scoredLinks).reduce(function (acc, link) {\n var scoredLink = scoredLinks[link];\n return scoredLink.score > acc.score ? scoredLink : acc;\n }, { score: -100 });\n\n // If the score is less than 50, we're not confident enough to use it,\n // so we fail.\n if (topPage.score >= 50) {\n return topPage.href;\n }\n\n return null;\n }\n};\n\nvar CANONICAL_META_SELECTORS = ['og:url'];\n\nfunction parseDomain(url) {\n var parsedUrl = URL.parse(url);\n var hostname = parsedUrl.hostname;\n\n return hostname;\n}\n\nfunction result(url) {\n return {\n url: url,\n domain: parseDomain(url)\n };\n}\n\nvar GenericUrlExtractor = {\n extract: function extract(_ref) {\n var $ = _ref.$,\n url = _ref.url,\n metaCache = _ref.metaCache;\n\n var $canonical = $('link[rel=canonical]');\n if ($canonical.length !== 0) {\n var href = $canonical.attr('href');\n if (href) {\n return result(href);\n }\n }\n\n var metaUrl = extractFromMeta$$1($, CANONICAL_META_SELECTORS, metaCache);\n if (metaUrl) {\n return result(metaUrl);\n }\n\n return result(url);\n }\n};\n\nvar EXCERPT_META_SELECTORS = ['og:description', 'twitter:description'];\n\nfunction clean$2(content, $) {\n var maxLength = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 200;\n\n content = content.replace(/[\\s\\n]+/g, ' ').trim();\n return ellipsize(content, maxLength, { ellipse: '&hellip;' });\n}\n\nvar GenericExcerptExtractor = {\n extract: function extract(_ref) {\n var $ = _ref.$,\n content = _ref.content,\n metaCache = _ref.metaCache;\n\n var excerpt = extractFromMeta$$1($, EXCERPT_META_SELECTORS, metaCache);\n if (excerpt) {\n return clean$2(stripTags(excerpt, $));\n }\n // Fall back to excerpting from the extracted content\n var maxLength = 200;\n var shortContent = content.slice(0, maxLength * 5);\n return clean$2($(shortContent).text(), $, maxLength);\n }\n};\n\nvar GenericWordCountExtractor = {\n extract: function extract(_ref) {\n var content = _ref.content;\n\n var $ = cheerio.load(content);\n var $content = $('div').first();\n\n var text = normalizeSpaces($content.text());\n return text.split(/\\s/).length;\n }\n};\n\nvar GenericExtractor = {\n // This extractor is the default for all domains\n domain: '*',\n title: GenericTitleExtractor.extract,\n date_published: GenericDatePublishedExtractor.extract,\n author: GenericAuthorExtractor.extract,\n content: GenericContentExtractor.extract.bind(GenericContentExtractor),\n lead_image_url: GenericLeadImageUrlExtractor.extract,\n dek: GenericDekExtractor.extract,\n next_page_url: GenericNextPageUrlExtractor.extract,\n url_and_domain: GenericUrlExtractor.extract,\n excerpt: GenericExcerptExtractor.extract,\n word_count: GenericWordCountExtractor.extract,\n direction: function direction(_ref) {\n var title = _ref.title;\n return stringDirection.getDirection(title);\n },\n\n extract: function extract(options) {\n var html = options.html,\n $ = options.$;\n\n\n if (html && !$) {\n var loaded = cheerio.load(html);\n options.$ = loaded;\n }\n\n var title = this.title(options);\n var date_published = this.date_published(options);\n var author = this.author(options);\n var content = this.content(_extends({}, options, { title: title }));\n var lead_image_url = this.lead_image_url(_extends({}, options, { content: content }));\n var dek = this.dek(_extends({}, options, { content: content }));\n var next_page_url = this.next_page_url(options);\n var excerpt = this.excerpt(_extends({}, options, { content: content }));\n var word_count = this.word_count(_extends({}, options, { content: content }));\n var direction = this.direction({ title: title });\n\n var _url_and_domain = this.url_and_domain(options),\n url = _url_and_domain.url,\n domain = _url_and_domain.domain;\n\n return {\n title: title,\n author: author,\n date_published: date_published || null,\n dek: dek,\n lead_image_url: lead_image_url,\n content: content,\n next_page_url: next_page_url,\n url: url,\n domain: domain,\n excerpt: excerpt,\n word_count: word_count,\n direction: direction\n };\n }\n};\n\nvar Detectors = {\n 'meta[name=\"al:ios:app_name\"][value=\"Medium\"]': MediumExtractor,\n 'meta[name=\"generator\"][value=\"blogger\"]': BloggerExtractor\n};\n\nfunction detectByHtml($) {\n var selector = _Reflect$ownKeys(Detectors).find(function (s) {\n return $(s).length > 0;\n });\n\n return Detectors[selector];\n}\n\nfunction getExtractor(url, parsedUrl, $) {\n parsedUrl = parsedUrl || URL.parse(url);\n var _parsedUrl = parsedUrl,\n hostname = _parsedUrl.hostname;\n\n var baseDomain = hostname.split('.').slice(-2).join('.');\n\n return Extractors[hostname] || Extractors[baseDomain] || detectByHtml($) || GenericExtractor;\n}\n\n// Remove elements by an array of selectors\nfunction cleanBySelectors($content, $, _ref) {\n var clean = _ref.clean;\n\n if (!clean) return $content;\n\n $(clean.join(','), $content).remove();\n\n return $content;\n}\n\n// Transform matching elements\nfunction transformElements($content, $, _ref2) {\n var transforms = _ref2.transforms;\n\n if (!transforms) return $content;\n\n _Reflect$ownKeys(transforms).forEach(function (key) {\n var $matches = $(key, $content);\n var value = transforms[key];\n\n // If value is a string, convert directly\n if (typeof value === 'string') {\n $matches.each(function (index, node) {\n convertNodeTo$$1($(node), $, transforms[key]);\n });\n } else if (typeof value === 'function') {\n // If value is function, apply function to node\n $matches.each(function (index, node) {\n var result = value($(node), $);\n // If function returns a string, convert node to that value\n if (typeof result === 'string') {\n convertNodeTo$$1($(node), $, result);\n }\n });\n }\n });\n\n return $content;\n}\n\nfunction findMatchingSelector($, selectors, extractHtml) {\n return selectors.find(function (selector) {\n if (Array.isArray(selector)) {\n if (extractHtml) {\n return selector.reduce(function (acc, s) {\n return acc && $(s).length > 0;\n }, true);\n }\n\n var _selector = _slicedToArray(selector, 2),\n s = _selector[0],\n attr = _selector[1];\n\n return $(s).length === 1 && $(s).attr(attr) && $(s).attr(attr).trim() !== '';\n }\n\n return $(selector).length === 1 && $(selector).text().trim() !== '';\n });\n}\n\nfunction select(opts) {\n var $ = opts.$,\n type = opts.type,\n extractionOpts = opts.extractionOpts,\n _opts$extractHtml = opts.extractHtml,\n extractHtml = _opts$extractHtml === undefined ? false : _opts$extractHtml;\n // Skip if there's not extraction for this type\n\n if (!extractionOpts) return null;\n\n // If a string is hardcoded for a type (e.g., Wikipedia\n // contributors), return the string\n if (typeof extractionOpts === 'string') return extractionOpts;\n\n var selectors = extractionOpts.selectors,\n _extractionOpts$defau = extractionOpts.defaultCleaner,\n defaultCleaner = _extractionOpts$defau === undefined ? true : _extractionOpts$defau;\n\n\n var matchingSelector = findMatchingSelector($, selectors, extractHtml);\n\n if (!matchingSelector) return null;\n\n // Declaring result; will contain either\n // text or html, which will be cleaned\n // by the appropriate cleaner type\n\n // If the selector type requests html as its return type\n // transform and clean the element with provided selectors\n var $content = void 0;\n if (extractHtml) {\n // If matching selector is an array, we're considering this a\n // multi-match selection, which allows the parser to choose several\n // selectors to include in the result. Note that all selectors in the\n // array must match in order for this selector to trigger\n if (Array.isArray(matchingSelector)) {\n (function () {\n $content = $(matchingSelector.join(','));\n var $wrapper = $('<div></div>');\n $content.each(function (index, element) {\n $wrapper.append(element);\n });\n\n $content = $wrapper;\n })();\n } else {\n $content = $(matchingSelector);\n }\n\n // Wrap in div so transformation can take place on root element\n $content.wrap($('<div></div>'));\n $content = $content.parent();\n\n $content = transformElements($content, $, extractionOpts);\n $content = cleanBySelectors($content, $, extractionOpts);\n\n $content = Cleaners[type]($content, _extends({}, opts, { defaultCleaner: defaultCleaner }));\n\n return $.html($content);\n }\n\n var result = void 0;\n\n // if selector is an array (e.g., ['img', 'src']),\n // extract the attr\n if (Array.isArray(matchingSelector)) {\n var _matchingSelector = _slicedToArray(matchingSelector, 2),\n selector = _matchingSelector[0],\n attr = _matchingSelector[1];\n\n result = $(selector).attr(attr).trim();\n } else {\n var $node = $(matchingSelector);\n\n $node = cleanBySelectors($node, $, extractionOpts);\n $node = transformElements($node, $, extractionOpts);\n\n result = $node.text().trim();\n }\n\n // Allow custom extractor to skip default cleaner\n // for this type; defaults to true\n if (defaultCleaner) {\n return Cleaners[type](result, _extends({}, opts, extractionOpts));\n }\n\n return result;\n}\n\nfunction extractResult(opts) {\n var type = opts.type,\n extractor = opts.extractor,\n _opts$fallback = opts.fallback,\n fallback = _opts$fallback === undefined ? true : _opts$fallback;\n\n\n var result = select(_extends({}, opts, { extractionOpts: extractor[type] }));\n\n // If custom parser succeeds, return the result\n if (result) {\n return result;\n }\n\n // If nothing matches the selector, and fallback is enabled,\n // run the Generic extraction\n if (fallback) return GenericExtractor[type](opts);\n\n return null;\n}\n\nvar RootExtractor = {\n extract: function extract() {\n var extractor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : GenericExtractor;\n var opts = arguments[1];\n var _opts = opts,\n contentOnly = _opts.contentOnly,\n extractedTitle = _opts.extractedTitle;\n // This is the generic extractor. Run its extract method\n\n if (extractor.domain === '*') return extractor.extract(opts);\n\n opts = _extends({}, opts, {\n extractor: extractor\n });\n\n if (contentOnly) {\n var _content = extractResult(_extends({}, opts, { type: 'content', extractHtml: true, title: extractedTitle\n }));\n return {\n content: _content\n };\n }\n var title = extractResult(_extends({}, opts, { type: 'title' }));\n var date_published = extractResult(_extends({}, opts, { type: 'date_published' }));\n var author = extractResult(_extends({}, opts, { type: 'author' }));\n var next_page_url = extractResult(_extends({}, opts, { type: 'next_page_url' }));\n var content = extractResult(_extends({}, opts, { type: 'content', extractHtml: true, title: title\n }));\n var lead_image_url = extractResult(_extends({}, opts, { type: 'lead_image_url', content: content }));\n var excerpt = extractResult(_extends({}, opts, { type: 'excerpt', content: content }));\n var dek = extractResult(_extends({}, opts, { type: 'dek', content: content, excerpt: excerpt }));\n var word_count = extractResult(_extends({}, opts, { type: 'word_count', content: content }));\n var direction = extractResult(_extends({}, opts, { type: 'direction', title: title }));\n\n var _ref3 = extractResult(_extends({}, opts, { type: 'url_and_domain' })) || { url: null, domain: null },\n url = _ref3.url,\n domain = _ref3.domain;\n\n return {\n title: title,\n content: content,\n author: author,\n date_published: date_published,\n lead_image_url: lead_image_url,\n dek: dek,\n next_page_url: next_page_url,\n url: url,\n domain: domain,\n excerpt: excerpt,\n word_count: word_count,\n direction: direction\n };\n }\n};\n\nvar collectAllPages = (function () {\n var _ref = _asyncToGenerator(_regeneratorRuntime.mark(function _callee(_ref2) {\n var next_page_url = _ref2.next_page_url,\n html = _ref2.html,\n $ = _ref2.$,\n metaCache = _ref2.metaCache,\n result = _ref2.result,\n Extractor = _ref2.Extractor,\n title = _ref2.title,\n url = _ref2.url;\n var pages, previousUrls, extractorOpts, nextPageResult, word_count;\n return _regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n // At this point, we've fetched just the first page\n pages = 1;\n previousUrls = [removeAnchor(url)];\n\n // If we've gone over 26 pages, something has\n // likely gone wrong.\n\n case 2:\n if (!(next_page_url && pages < 26)) {\n _context.next = 15;\n break;\n }\n\n pages += 1;\n _context.next = 6;\n return Resource.create(next_page_url);\n\n case 6:\n $ = _context.sent;\n\n html = $.html();\n\n extractorOpts = {\n url: next_page_url,\n html: html,\n $: $,\n metaCache: metaCache,\n contentOnly: true,\n extractedTitle: title,\n previousUrls: previousUrls\n };\n nextPageResult = RootExtractor.extract(Extractor, extractorOpts);\n\n\n previousUrls.push(next_page_url);\n result = _extends({}, result, {\n content: result.content + '<hr><h4>Page ' + pages + '</h4>' + nextPageResult.content\n });\n\n next_page_url = nextPageResult.next_page_url;\n _context.next = 2;\n break;\n\n case 15:\n word_count = GenericExtractor.word_count({ content: '<div>' + result.content + '</div>' });\n return _context.abrupt('return', _extends({}, result, {\n total_pages: pages,\n pages_rendered: pages,\n word_count: word_count\n }));\n\n case 17:\n case 'end':\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function collectAllPages(_x) {\n return _ref.apply(this, arguments);\n }\n\n return collectAllPages;\n})();\n\nvar Mercury = {\n parse: function parse(url, html) {\n var _this = this;\n\n var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n return _asyncToGenerator(_regeneratorRuntime.mark(function _callee() {\n var _opts$fetchAllPages, fetchAllPages, _opts$fallback, fallback, parsedUrl, $, Extractor, metaCache, result, _result, title, next_page_url;\n\n return _regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _opts$fetchAllPages = opts.fetchAllPages, fetchAllPages = _opts$fetchAllPages === undefined ? true : _opts$fetchAllPages, _opts$fallback = opts.fallback, fallback = _opts$fallback === undefined ? true : _opts$fallback;\n\n // if no url was passed and this is the browser version,\n // set url to window.location.href and load the html\n // from the current page\n\n if (!url && cheerio.browser) {\n url = window.location.href; // eslint-disable-line no-undef\n html = html || cheerio.html();\n }\n\n parsedUrl = URL.parse(url);\n\n if (validateUrl(parsedUrl)) {\n _context.next = 5;\n break;\n }\n\n return _context.abrupt('return', Errors.badUrl);\n\n case 5:\n _context.next = 7;\n return Resource.create(url, html, parsedUrl);\n\n case 7:\n $ = _context.sent;\n Extractor = getExtractor(url, parsedUrl, $);\n // console.log(`Using extractor for ${Extractor.domain}`);\n\n // If we found an error creating the resource, return that error\n\n if (!$.failed) {\n _context.next = 11;\n break;\n }\n\n return _context.abrupt('return', $);\n\n case 11:\n\n // if html still has not been set (i.e., url passed to Mercury.parse),\n // set html from the response of Resource.create\n if (!html) {\n html = $.html();\n }\n\n // Cached value of every meta name in our document.\n // Used when extracting title/author/date_published/dek\n metaCache = $('meta').map(function (_, node) {\n return $(node).attr('name');\n }).toArray();\n result = RootExtractor.extract(Extractor, {\n url: url,\n html: html,\n $: $,\n metaCache: metaCache,\n parsedUrl: parsedUrl,\n fallback: fallback\n });\n _result = result, title = _result.title, next_page_url = _result.next_page_url;\n\n // Fetch more pages if next_page_url found\n\n if (!(fetchAllPages && next_page_url)) {\n _context.next = 21;\n break;\n }\n\n _context.next = 18;\n return collectAllPages({\n Extractor: Extractor,\n next_page_url: next_page_url,\n html: html,\n $: $,\n metaCache: metaCache,\n result: result,\n title: title,\n url: url\n });\n\n case 18:\n result = _context.sent;\n _context.next = 22;\n break;\n\n case 21:\n result = _extends({}, result, {\n total_pages: 1,\n rendered_pages: 1\n });\n\n case 22:\n return _context.abrupt('return', result);\n\n case 23:\n case 'end':\n return _context.stop();\n }\n }\n }, _callee, _this);\n }))();\n },\n\n\n browser: !!cheerio.browser,\n\n // A convenience method for getting a resource\n // to work with, e.g., for custom extractor generator\n fetchResource: function fetchResource(url) {\n var _this2 = this;\n\n return _asyncToGenerator(_regeneratorRuntime.mark(function _callee2() {\n return _regeneratorRuntime.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return Resource.create(url);\n\n case 2:\n return _context2.abrupt('return', _context2.sent);\n\n case 3:\n case 'end':\n return _context2.stop();\n }\n }\n }, _callee2, _this2);\n }))();\n }\n};\n\nmodule.exports = Mercury;\n//# sourceMappingURL=mercury.js.map\n","export default function insertValues(strings, ...values) {\n if (values.length) {\n return strings.reduce((result, part, idx) => {\n let value = values[idx];\n\n if (value && typeof value.toString === 'function') {\n value = value.toString();\n } else {\n value = '';\n }\n\n return result + part + value;\n }, '');\n }\n\n return strings.join('');\n}\n","import insertValues from './insert-values';\n\nconst bodyPattern = /^\\n([\\s\\S]+)\\s{2}$/gm;\nconst trailingWhitespace = /\\s+$/;\n\nexport default function template(strings, ...values) {\n const compiled = insertValues(strings, ...values);\n let [body] = compiled.match(bodyPattern) || [];\n let indentLevel = /^\\s{0,4}(.+)$/g;\n\n if (!body) {\n body = compiled;\n indentLevel = /^\\s{0,2}(.+)$/g;\n }\n\n return body.split('\\n')\n .slice(1)\n .map((line) => {\n line = line.replace(indentLevel, '$1');\n\n if (trailingWhitespace.test(line)) {\n line = line.replace(trailingWhitespace, '');\n }\n\n return line;\n })\n .join('\\n');\n}\n","import template from './index';\n\nexport default function (hostname, name) {\n return template`\n export const ${name} = {\n domain: '${hostname}',\n\n title: {\n selectors: [\n // enter title selectors\n ],\n },\n\n author: {\n selectors: [\n // enter author selectors\n ],\n },\n\n date_published: {\n selectors: [\n // enter selectors\n ],\n },\n\n dek: {\n selectors: [\n // enter selectors\n ],\n },\n\n lead_image_url: {\n selectors: [\n // enter selectors\n ],\n },\n\n content: {\n selectors: [\n // enter content selectors\n ],\n\n // Is there anything in the content you selected that needs transformed\n // before it's consumable content? E.g., unusual lazy loaded images\n transforms: {\n },\n\n // Is there anything that is in the result that shouldn't be?\n // The clean selectors will remove anything that matches from\n // the result\n clean: [\n\n ]\n },\n }\n `;\n}\n","import template from './index';\n\nconst IGNORE = [\n 'url',\n 'domain',\n 'content',\n 'word_count',\n 'next_page_url',\n 'excerpt',\n 'direction',\n 'total_pages',\n 'rendered_pages',\n];\n\nfunction testFor(key, value, dir) {\n if (IGNORE.find(k => k === key)) return '';\n\n return template`\n it('returns the ${key}', async () => {\n // To pass this test, fill out the ${key} selector\n // in ${dir}/index.js.\n const { ${key} } = await result\n\n // Update these values with the expected values from\n // the article.\n assert.equal(${key}, ${value ? `\\`${value}\\`` : \"''\"})\n });\n `;\n}\n\nexport default function (file, url, dir, result, name) {\n return template`\n import assert from 'assert';\n import fs from 'fs';\n import URL from 'url';\n import cheerio from 'cheerio';\n\n import Mercury from 'mercury';\n import getExtractor from 'extractors/get-extractor';\n import { excerptContent } from 'utils/text';\n\n describe('${name}', () => {\n describe('initial test case', () => {\n let result;\n let url;\n beforeAll(() => {\n url =\n '${url}';\n const html =\n fs.readFileSync('${file}');\n result =\n Mercury.parse(url, html, { fallback: false });\n });\n\n it('is selected properly', () => {\n // This test should be passing by default.\n // It sanity checks that the correct parser\n // is being selected for URLs from this domain\n const extractor = getExtractor(url);\n assert.equal(extractor.domain, URL.parse(url).hostname)\n })\n\n ${Reflect.ownKeys(result).map(k => testFor(k, result[k], dir)).join('\\n\\n')}\n\n it('returns the content', async () => {\n // To pass this test, fill out the content selector\n // in ${dir}/index.js.\n // You may also want to make use of the clean and transform\n // options.\n const { content } = await result;\n\n const $ = cheerio.load(content || '');\n\n const first13 = excerptContent($('*').first().text(), 13)\n\n // Update these values with the expected values from\n // the article.\n assert.equal(first13, 'Add the first 13 words of the article here');\n });\n });\n });\n `;\n}\n","/* eslint-disable import/no-extraneous-dependencies */\n/* eslint-disable no-use-before-define */\n/* eslint-disable no-console */\nimport fs from 'fs';\nimport URL from 'url';\nimport inquirer from 'inquirer';\nimport ora from 'ora';\nimport { exec } from 'child_process';\n\nimport {\n stripJunkTags,\n makeLinksAbsolute,\n} from 'utils/dom';\nimport Mercury from '../dist/mercury';\nimport extractorTemplate from './templates/custom-extractor';\nimport extractorTestTemplate from './templates/custom-extractor-test';\n\nconst questions = [\n {\n type: 'input',\n name: 'website',\n message: 'Paste a url to an article you\\'d like to create or extend a parser for:',\n validate(value) {\n const { hostname } = URL.parse(value);\n if (hostname) return true;\n\n return false;\n },\n },\n];\nlet spinner;\n\nfunction confirm(fn, args, msg, newParser) {\n spinner = ora({ text: msg });\n spinner.start();\n const result = fn(...args);\n\n if (result && result.then) {\n result.then(r => savePage(r, args, newParser));\n } else {\n spinner.succeed();\n }\n\n return result;\n}\n\nfunction confirmCreateDir(dir, msg) {\n if (!fs.existsSync(dir)) {\n confirm(fs.mkdirSync, [dir], msg);\n }\n}\n\nfunction getDir(url) {\n const { hostname } = URL.parse(url);\n return `./src/extractors/custom/${hostname}`;\n}\n\nfunction scaffoldCustomParser(url) {\n const dir = getDir(url);\n const { hostname } = URL.parse(url);\n let newParser = false;\n\n if (!fs.existsSync(dir)) {\n newParser = true;\n confirmCreateDir(dir, `Creating ${hostname} directory`);\n confirmCreateDir(`./fixtures/${hostname}`, 'Creating fixtures directory');\n }\n\n confirm(Mercury.fetchResource, [url], 'Fetching fixture', newParser);\n}\n\n// if has arg, just assume that arg is a url and skip prmopt\nconst urlArg = process.argv[2];\nif (urlArg) {\n scaffoldCustomParser(urlArg);\n} else {\n inquirer.prompt(questions).then((answers) => {\n scaffoldCustomParser(answers.website);\n });\n}\n\nfunction generateScaffold(url, file, result) {\n const { hostname } = URL.parse(url);\n const extractor = extractorTemplate(hostname, extractorName(hostname));\n const extractorTest =\n extractorTestTemplate(\n file, url, getDir(url), result, extractorName(hostname)\n );\n\n fs.writeFileSync(`${getDir(url)}/index.js`, extractor);\n fs.writeFileSync(`${getDir(url)}/index.test.js`, extractorTest);\n fs.appendFileSync(\n './src/extractors/custom/index.js',\n exportString(url),\n );\n exec(`npm run lint-fix-quiet -- ${getDir(url)}/*.js`);\n}\n\nfunction savePage($, [url], newParser) {\n const { hostname } = URL.parse(url);\n\n spinner.succeed();\n\n const filename = new Date().getTime();\n const file = `./fixtures/${hostname}/${filename}.html`;\n // fix http(s) relative links:\n makeLinksAbsolute($('*').first(), $, url);\n $('[src], [href]').each((index, node) => {\n const $node = $(node);\n const link = $node.attr('src');\n if (link && link.slice(0, 2) === '//') {\n $node.attr('src', `http:${link}`);\n }\n });\n const html = stripJunkTags($('*').first(), $, ['script']).html();\n\n fs.writeFileSync(file, html);\n\n Mercury.parse(url, html).then((result) => {\n if (newParser) {\n confirm(generateScaffold, [url, file, result], 'Generating parser and tests');\n console.log(`Your custom site extractor has been set up. To get started building it, run\n yarn watch:test -- ${hostname}\n -- OR --\n npm run watch:test -- ${hostname}`);\n } else {\n console.log(`\n It looks like you already have a custom parser for this url.\n The page you linked to has been added to ${file}. Copy and paste\n the following code to use that page in your tests:\n const html = fs.readFileSync('${file}');`);\n }\n });\n}\n\nfunction exportString(url) {\n const { hostname } = URL.parse(url);\n return `export * from './${hostname}';`;\n}\n\nfunction extractorName(hostname) {\n const name = hostname\n .split('.')\n .map(w => `${w.charAt(0).toUpperCase()}${w.slice(1)}`)\n .join('');\n return `${name}Extractor`;\n}\n"],"names":["SPACER_RE","RegExp","KEEP_CLASS","KEEP_SELECTORS","STRIP_OUTPUT_TAGS","REMOVE_ATTRS","REMOVE_ATTR_SELECTORS","map","selector","REMOVE_ATTR_LIST","join","WHITELIST_ATTRS","WHITELIST_ATTRS_RE","REMOVE_EMPTY_TAGS","REMOVE_EMPTY_SELECTORS","tag","CLEAN_CONDITIONALLY_TAGS","HEADER_TAGS","HEADER_TAG_LIST","UNLIKELY_CANDIDATES_BLACKLIST","UNLIKELY_CANDIDATES_WHITELIST","DIV_TO_P_BLOCK_TAGS","IS_WP_SELECTOR","BLOCK_LEVEL_TAGS","BLOCK_LEVEL_TAGS_RE","candidatesBlacklist","CANDIDATES_BLACKLIST","candidatesWhitelist","CANDIDATES_WHITELIST","brsToPs","$","collapsing","each","index","element","$element","nextElement","next","get","tagName","toLowerCase","remove","paragraphize","node","br","$node","sibling","nextSibling","p","test","appendTo","replaceWith","convertDivs","div","$div","convertable","children","length","convertSpans","span","$span","parents","convertNodeTo","attrs","getAttrs","attribString","key","html","browser","text","contents","cleanForHeight","$img","height","parseInt","attr","width","removeAttr","removeSpacers","stripJunkTags","article","tags","not","removeAllButWhitelist","$article","find","reduce","acc","removeClass","NON_TOP_CANDIDATE_TAGS","NON_TOP_CANDIDATE_TAGS_RE","HNEWS_CONTENT_SELECTORS","PHOTO_HINTS","PHOTO_HINTS_RE","POSITIVE_SCORE_HINTS","POSITIVE_SCORE_RE","READABILITY_ASSET","NEGATIVE_SCORE_HINTS","NEGATIVE_SCORE_RE","DIGIT_RE","BR_TAGS_RE","BR_TAG_RE","UNLIKELY_RE","PARAGRAPH_SCORE_TAGS","CHILD_CONTENT_TAGS","BAD_TAGS","HTML_OR_BODY_RE","getWeight","classes","id","score","getScore","parseFloat","scoreCommas","match","idkRe","scoreLength","textLength","chunks","lengthBonus","Math","min","max","scoreParagraph","trim","slice","setScore","addScore","amount","getOrInitScore","e","addToParent","parent","weightNodes","scoreNode","addScoreTo","scorePs","$parent","rawScore","NORMALIZE_RE","normalizeSpaces","replace","PAGE_IN_HREF_RE","HAS_ALPHA_RE","IS_ALPHA_RE","IS_DIGIT_RE","ENCODING_RE","DEFAULT_ENCODING","isGoodSegment","segment","firstSegmentHasLetters","goodSegment","SENTENCE_END_RE","hasSentenceEnd","mergeSiblings","$candidate","topScore","siblingScoreThreshold","wrappingDiv","$sibling","siblingScore","append","contentBonus","density","linkDensity","newScore","siblingContent","siblingContentLength","first","removeUnlessContent","weight","hasClass","content","pCount","inputCount","contentLength","imgCount","nodeIsList","previousNode","prev","scriptCount","absolutize","rootUrl","$content","_","url","absoluteUrl","URL","resolve","makeLinksAbsolute","forEach","totalTextLength","linkText","linkLength","isGoodNode","maxChildren","withinComment","stripTags","cleanText","toArray","commentParent","nodeClass","class","classAndId","includes","undefined","attribs","attributes","name","value","setAttr","val","setAttribute","setAttrs","removeAttribute","ex","_interopDefault","require$$22","require$$21","require$$20","require$$19","require$$18","require$$17","require$$16","require$$15","require$$14","require$$13","require$$12","require$$11","require$$10","require$$9","require$$8","require$$7","require$$6","require$$5","require$$4","require$$3","require$$2","require$$1","require$$0","regexList","re","matchRe","exec","matches","pageNum","split","parsed","parse","parsedUrl","protocol","host","path","reverse","rawSegment","_segment$split2","_slicedToArray","_segment$split","possibleSegment","fileExt","push","cleanedSegments","arguments","words","str","iconv","encodingExists","testEncode","encoding","range","_regeneratorRuntime","mark","wrap","_context","start","end","stop","_marked","_ref","hostname","badUrl","error","messages","cheerio","BAD_CONTENT_TYPES","options","reject","request","err","response","body","statusMessage","statusCode","parseNon2xx","headers","contentType","_response$headers","BAD_CONTENT_TYPES_RE","MAX_CONTENT_LENGTH","_asyncToGenerator","_ref3","encodeURI","href","_extends","REQUEST_HEADERS","timeout","FETCH_TIMEOUT","jar","gzip","followAllRedirects","sent","validateResponse","abrupt","t0","Errors","_callee","_x2","_x3","apply","from","to","convertMetaProp","convertNodeTo$$1","brsToPs$$1","_Reflect$ownKeys","img","_URL$parse","concat","_toConsumableArray","addClass","$hOnes","_defineProperty","$p","NON_TOP_CANDIDATE_TAGS$1","PHOTO_HINTS$1","POSITIVE_SCORE_HINTS$1","NEGATIVE_SCORE_HINTS$1","UNLIKELY_CANDIDATES_BLACKLIST$1","UNLIKELY_CANDIDATES_WHITELIST$1","POSITIVE_SCORE_RE$1","NEGATIVE_SCORE_RE$1","PHOTO_HINTS_RE$1","READABILITY_ASSET$1","getOrInitScore$$1","addScore$$1","scoreNode$$1","addToParent$$1","_$node$get","PARAGRAPH_SCORE_TAGS$1","CHILD_CONTENT_TAGS$1","BAD_TAGS$1","convertSpans$1","HNEWS_CONTENT_SELECTORS$1","parentSelector","_ref2","childSelector","NON_TOP_CANDIDATE_TAGS_RE$1","header","$header","prevAll","title","metaNames","cachedNames","filter","indexOf","_step","type","nodes","values","cleanTags$$1","metaValue","v","_getIterator","foundNames","_iteratorNormalCompletion","_iterator","done","_loop","_typeof","_ret","_didIteratorError","_iteratorError","return","withinComment$$1","selectors","textOnly","IS_LINK","IS_IMAGE","root","isComment","TAGS_TO_REMOVE","cleanComments","create","preparedResponse","validResponse","result","failed","_this","generateDoc","encodeDoc","normalizeMetaTags","convertLazyLoadedImages","clean","getEncoding","decode","load","decodedContent","metaContentType","properEncoding","extractor","domains","domain","supportedDomains","merge","transforms","noscript","author","date_published","h1","$children","dek","defaultCleaner","prepend","$tweetContainer","tweets","s","src","lead_image_url","next_page_url","excerpt","timezone","h2","has","youtubeId","JSON","data","sources","iframe","decodeURIComponent","ytRe","thumb","_thumb$match2","_thumb$match","empty","$caption","figure","$text","videoId","imgHtml","format","$imgSrc","$imageParent","$dataAttrContainer","imgPath2","imgPath1","$figure","WwwMsnbcComExtractor","_WwwMsnbcComExtractor","BloggerExtractor","NYMagExtractor","WikipediaExtractor","TwitterExtractor","NYTimesExtractor","TheAtlanticExtractor","NewYorkerExtractor","WiredExtractor","MSNExtractor","YahooExtractor","BuzzfeedExtractor","WikiaExtractor","LittleThingsExtractor","PoliticoExtractor","DeadspinExtractor","BroadwayWorldExtractor","ApartmentTherapyExtractor","MediumExtractor","WwwTmzComExtractor","WwwWashingtonpostComExtractor","WwwHuffingtonpostComExtractor","NewrepublicComExtractor","MoneyCnnComExtractor","WwwThevergeComExtractor","WwwCnnComExtractor","WwwAolComExtractor","WwwYoutubeComExtractor","WwwTheguardianComExtractor","WwwSbnationComExtractor","WwwBloombergComExtractor","WwwBustleComExtractor","WwwNprOrgExtractor","WwwRecodeNetExtractor","QzComExtractor","WwwDmagazineComExtractor","WwwReutersComExtractor","MashableComExtractor","WwwChicagotribuneComExtractor","WwwVoxComExtractor","NewsNationalgeographicComExtractor","WwwNationalgeographicComExtractor","WwwLatimesComExtractor","PagesixComExtractor","ThefederalistpapersOrgExtractor","WwwCbssportsComExtractor","WwwThepoliticalinsiderComExtractor","WwwMentalflossComExtractor","AbcnewsGoComExtractor","WwwNydailynewsComExtractor","WwwCnbcComExtractor","WwwPopsugarComExtractor","ObserverComExtractor","PeopleComExtractor","WwwUsmagazineComExtractor","WwwRollingstoneComExtractor","twofortysevensportsComExtractor","UproxxComExtractor","WwwEonlineComExtractor","WwwMiamiheraldComExtractor","WwwRefinery29ComExtractor","WwwMacrumorsComExtractor","WwwAndroidcentralComExtractor","WwwSiComExtractor","WwwRawstoryComExtractor","WwwCnetComExtractor","WwwCinemablendComExtractor","WwwTodayComExtractor","WwwHowtogeekComExtractor","WwwAlComExtractor","WwwThepennyhoarderComExtractor","WwwWesternjournalismComExtractor","FusionNetExtractor","WwwAmericanowComExtractor","ScienceflyComExtractor","HellogigglesComExtractor","ThoughtcatalogComExtractor","WwwNjComExtractor","WwwInquisitrComExtractor","WwwNbcnewsComExtractor","FortuneComExtractor","WwwLinkedinComExtractor","ObamawhitehouseArchivesGovExtractor","WwwOpposingviewsComExtractor","WwwProspectmagazineCoUkExtractor","ForwardComExtractor","WwwQdailyComExtractor","GothamistComExtractor","WwwFoolComExtractor","WwwSlateComExtractor","IciRadioCanadaCaExtractor","_Object$keys","CustomExtractors","mergeSupportedDomains","months","timestamp1","timestamp2","timestamp3","allMonths","CLEAN_AUTHOR_RE","leadImageUrl","validUrl","isWebUri","excerptContent","TEXT_LINK_RE","dekText","dateString","SPLIT_DATE_STRING","TIME_MERIDIAN_DOTS_RE","TIME_MERIDIAN_SPACE_RE","CLEAN_DATE_STRING_RE","TIME_WITH_OFFSET_RE","moment","tz","parseFormat","MS_DATE_STRING","SEC_DATE_STRING","toISOString","createDate","date","isValid","cleanDateString","_ref$cleanConditional","cleanConditionally","_ref$title","_ref$url","_ref$defaultCleaner","rewriteTopLevel$$1","cleanImages","makeLinksAbsolute$$1","markToKeep","cleanHOnes$$1","cleanHeaders","removeEmpty","cleanAttributes$$1","TITLE_SPLITTERS_RE","resolveSplitTitle","splitTitle","titleText","termCounts","_Reflect$ownKeys$redu2","_Reflect$ownKeys$redu","maxTerm","termCount","splitEnds","longestEnd","DOMAIN_ENDINGS_RE","wuzzy","levenshtein","startSlug","nakedDomain","startSlugRatio","endSlug","endSlugRatio","extractBreadcrumbTitle","newTitle","cleanDomainFromTitle","cleanAuthor","clean$1","cleanDek","cleanDatePublished","extractCleanNode","cleanTitle$$1","opts","stripUnlikelyCandidates","convertToParagraphs$$1","scoreContent$$1","findTopCandidate$$1","defaultOpts","extract","getContentNode","nodeIsSufficient","cleanAndReturnNode","k","extractBestNode","metaCache","extractFromMeta$$1","STRONG_TITLE_META_TAGS","extractFromSelectors$$1","STRONG_TITLE_SELECTORS","WEAK_TITLE_META_TAGS","WEAK_TITLE_SELECTORS","bylineRe","AUTHOR_META_TAGS","AUTHOR_MAX_LENGTH","AUTHOR_SELECTORS","BYLINE_SELECTORS_RE","_ref4","regex","abbrevMonthsStr","datePublished","DATE_PUBLISHED_META_TAGS","DATE_PUBLISHED_SELECTORS","extractFromUrl","DATE_PUBLISHED_URL_RES","POSITIVE_LEAD_IMAGE_URL_HINTS","NEGATIVE_LEAD_IMAGE_URL_HINTS","POSITIVE_LEAD_IMAGE_URL_HINTS_RE","NEGATIVE_LEAD_IMAGE_URL_HINTS_RE","GIF_RE","JPG_RE","$figParent","$gParent","getSig","area","round","$imgs","LEAD_IMAGE_URL_META_TAGS","imageUrl","cleanUrl","imgs","scoreImageUrl","scoreAttr","scoreByParents","scoreBySibling","scoreByDimensions","scoreByPosition","imgScores","topUrl","LEAD_IMAGE_URL_SELECTORS","articleUrl","SequenceMatcher","ratio","similarity","diffPercent","diffModifier","linkTextAsNum","isWp","EXTRANEOUS_LINK_HINTS$1","EXTRANEOUS_LINK_HINTS_RE$1","$link","_Array$from","makeSig$1","positiveMatch","PAGE_RE","parentData","negativeMatch","linkData","PREV_LINK_TEXT_RE$1","baseUrl","previousUrls","linkHost","DIGIT_RE$2","fragment","baseRegex","NEXT_LINK_TEXT_RE$1","CAP_LINK_TEXT_RE$1","links","_ref$previousUrls","makeBaseRegex","isWordpress","possiblePages","link","removeAnchor","shouldScore","makeSig","pageNumFromUrl","scoreBaseUrl","scoreNextLinkText","scoreCapLinks","scorePrevLink","scoreByParents$1","scoreExtraneousLinks","scorePageInLink","scoreLinkText","scoreSimilarity","possiblePage","scoredPages","articleBaseUrl","scoreLinks","scoredLinks","scoredLink","topPage","parseDomain","$canonical","CANONICAL_META_SELECTORS","metaUrl","maxLength","ellipse","EXCERPT_META_SELECTORS","shortContent","GenericTitleExtractor","GenericDatePublishedExtractor","GenericAuthorExtractor","GenericContentExtractor","bind","GenericLeadImageUrlExtractor","GenericDekExtractor","GenericNextPageUrlExtractor","url_and_domain","GenericUrlExtractor","GenericExcerptExtractor","word_count","GenericWordCountExtractor","direction","getDirection","loaded","_url_and_domain","Detectors","_parsedUrl","Extractors","baseDomain","detectByHtml","GenericExtractor","$matches","extractHtml","Array","isArray","_selector","extractionOpts","_opts$extractHtml","_extractionOpts$defau","findMatchingSelector","matchingSelector","$wrapper","transformElements","cleanBySelectors","Cleaners","_matchingSelector","_opts$fallback","fallback","select","contentOnly","_opts","extractedTitle","extractResult","_content","Extractor","extractorOpts","nextPageResult","pages","RootExtractor","total_pages","pages_rendered","_x","fetchAllPages","_result","_opts$fetchAllPages","window","location","validateUrl","getExtractor","rendered_pages","fetchResource","_context2","_callee2","_this2","Mercury","insertValues","strings","part","idx","toString","bodyPattern","trailingWhitespace","template","compiled","indentLevel","line","IGNORE","testFor","dir","file","questions","spinner","confirm","fn","args","msg","newParser","ora","then","savePage","r","succeed","confirmCreateDir","fs","existsSync","mkdirSync","getDir","scaffoldCustomParser","urlArg","process","argv","prompt","answers","website","generateScaffold","extractorTemplate","extractorName","extractorTest","extractorTestTemplate","writeFileSync","appendFileSync","exportString","filename","Date","getTime","log","w","charAt","toUpperCase"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA,AAAO,IAAMA,YAAY,IAAIC,MAAJ,CAAW,0BAAX,EAAuC,GAAvC,CAAlB;;;;AAIP,AAAO,IAAMC,aAAa,qBAAnB;;AAEP,AAAO,IAAMC,iBAAiB,CAC5B,wCAD4B,EAE5B,iDAF4B,EAG5B,uCAH4B,EAI5B,qCAJ4B,EAK5B,oCAL4B,CAAvB;;;AASP,AAAO,IAAMC,oBAAoB,CAC/B,OAD+B,EAE/B,QAF+B,EAG/B,UAH+B,EAI/B,MAJ+B,EAK/B,OAL+B,EAM/B,IAN+B,EAO/B,OAP+B,EAQ/B,QAR+B,EAS/B,QAT+B,CAA1B;;;AAaP,AAAO,IAAMC,eAAe,CAAC,OAAD,EAAU,OAAV,CAArB;AACP,AAAO,IAAMC,wBAAwBD,aAAaE,GAAb,CAAiB;eAAgBC,QAAhB;CAAjB,CAA9B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