diff --git a/fixtures/www.americanow.com/1482528557836.html b/fixtures/www.americanow.com/1482528557836.html new file mode 100644 index 000000000..072882cd7 --- /dev/null +++ b/fixtures/www.americanow.com/1482528557836.html @@ -0,0 +1 @@ + Kellyanne Conway Named Counselor To Trump
Politics

Kellyanne Conway Named Counselor To Trump

Kellyanne ConwayKellyanne Conway

President-elect Donald Trump has named Kellyanne Conway, the campaign manager who helped him win his unlikely presidential bid, to the position of counselor to the president.

"She is a tireless and tenacious advocate of my agenda and has amazing insights on how to effectively communicate our message,” the president-elect said in a statement, according to NBC News. “I am pleased that she will be part of my senior team in the West Wing."

Popular Video

This judge looked an inmate square in the eyes and did something that left the entire courtroom in tears:

Popular Video

This judge looked an inmate square in the eyes and did something that left the entire courtroom in tears:

Conway, who led the Trump campaign to victory by winning Rust Belt states pollsters believed would go solidly Democrat, will be the highest-ranking woman in Trump's cabinet and only the third woman to be named counselor to the president in American history.

The first woman to be named to the counselor to the president position was Anne Armstrong in 1973, when she filled the role for President Richard Nixon, according to the New York Times.

Karen Hughes also served as George W. Bush's first counselor to the president, according to NBC News.

On Dec. 1. Conway suggested she would not be working in the Trump White House, but instead would head a pro-Trump political operation.

“West Wing welcome mat is out, but we need a superstructure like the one Plouffe built,” Conway tweeted. “Plus, mom of four is not I'm most job descriptions.”

But the New York Times suggested Conway was holding out for a better offer within the Trump cabinet after she was offered a spokeswoman role she didn't want.

And being a mother of four is no longer seen as a hindrance for Conway.

"Essentially, my major concern is and will always be my four children, but I'm very convinced this is family-friendly West Wing and White House," she said, according to NBC News. "I've seen Donald Trump up close and personal with his own children and his grandchildren, and certainly his 10-year-old son and his wife. And I know that he is very pro-family."

Sources: New York Times (2), NBC News (2), Kellyanne Conway/Twitter/ Photo Credit: Gage Skidmore/Flickr

\ No newline at end of file diff --git a/src/extractors/custom/index.js b/src/extractors/custom/index.js index 92e9f3023..221359569 100644 --- a/src/extractors/custom/index.js +++ b/src/extractors/custom/index.js @@ -50,6 +50,7 @@ export * from './www.eonline.com'; export * from './www.miamiherald.com'; export * from './www.refinery29.com'; export * from './fusion.net'; +export * from './www.americanow.com'; export * from './sciencefly.com'; export * from './hellogiggles.com'; export * from './thoughtcatalog.com'; diff --git a/src/extractors/custom/www.americanow.com/index.js b/src/extractors/custom/www.americanow.com/index.js new file mode 100644 index 000000000..f14c4fd80 --- /dev/null +++ b/src/extractors/custom/www.americanow.com/index.js @@ -0,0 +1,54 @@ +export const WwwAmericanowComExtractor = { + domain: 'www.americanow.com', + + title: { + selectors: [ + '.title', + ['meta[name="title"]', 'value'], + ], + }, + + author: { + selectors: [ + '.byline', + ], + }, + + date_published: { + selectors: [ + ['meta[name="publish_date"]', 'value'], + ], + }, + + dek: { + selectors: [ + // enter selectors + ], + }, + + lead_image_url: { + selectors: [ + ['meta[name="og:image"]', 'value'], + ], + }, + + content: { + selectors: [ + ['.article-content', '.image', '.body'], + '.body', + ], + + // Is there anything in the content you selected that needs transformed + // before it's consumable content? E.g., unusual lazy loaded images + transforms: { + }, + + // Is there anything that is in the result that shouldn't be? + // The clean selectors will remove anything that matches from + // the result + clean: [ + '.article-video-wrapper', + '.show-for-small-only', + ], + }, +}; diff --git a/src/extractors/custom/www.americanow.com/index.test.js b/src/extractors/custom/www.americanow.com/index.test.js new file mode 100644 index 000000000..a1781ec8a --- /dev/null +++ b/src/extractors/custom/www.americanow.com/index.test.js @@ -0,0 +1,87 @@ +import assert from 'assert'; +import fs from 'fs'; +import URL from 'url'; +import cheerio from 'cheerio'; + +import Mercury from 'mercury'; +import getExtractor from 'extractors/get-extractor'; +import { excerptContent } from 'utils/text'; + +describe('WwwAmericanowComExtractor', () => { + describe('initial test case', () => { + let result; + let url; + beforeAll(() => { + url = + 'http://www.americanow.com/story/politics/2016/12/22/trump-names-kellyanne-conway-counselor-president'; + const html = + fs.readFileSync('./fixtures/www.americanow.com/1482528557836.html'); + result = + Mercury.parse(url, html, { fallback: false }); + }); + + it('is selected properly', () => { + // This test should be passing by default. + // It sanity checks that the correct parser + // is being selected for URLs from this domain + const extractor = getExtractor(url); + assert.equal(extractor.domain, URL.parse(url).hostname); + }); + + it('returns the title', async () => { + // To pass this test, fill out the title selector + // in ./src/extractors/custom/www.americanow.com/index.js. + const { title } = await result; + + // Update these values with the expected values from + // the article. + assert.equal(title, 'Kellyanne Conway Named Counselor To Trump'); + }); + + it('returns the author', async () => { + // To pass this test, fill out the author selector + // in ./src/extractors/custom/www.americanow.com/index.js. + const { author } = await result; + + // Update these values with the expected values from + // the article. + assert.equal(author, 'Ray Brown'); + }); + + it('returns the date_published', async () => { + // To pass this test, fill out the date_published selector + // in ./src/extractors/custom/www.americanow.com/index.js. + const { date_published } = await result; + + // Update these values with the expected values from + // the article. + assert.equal(date_published, '2016-12-22T14:22:19.000Z'); + }); + + it('returns the lead_image_url', async () => { + // To pass this test, fill out the lead_image_url selector + // in ./src/extractors/custom/www.americanow.com/index.js. + const { lead_image_url } = await result; + + // Update these values with the expected values from + // the article. + assert.equal(lead_image_url, 'http://images.americanow.com:8080/ovi/catalog/downloads/preview/rndr_670x377//2016/12/conway-1482422231.JPG/rndr_670x377.jpg'); + }); + + it('returns the content', async () => { + // To pass this test, fill out the content selector + // in ./src/extractors/custom/www.americanow.com/index.js. + // You may also want to make use of the clean and transform + // options. + const { content } = await result; + + const $ = cheerio.load(content || ''); + + const first13 = excerptContent($('*').first().text(), 13); + + // Update these values with the expected values from + // the article. + assert.equal(first13, 'President-elect Donald Trump has named Kellyanne Conway, the campaign manager who helped him'); + }); + }); +});