diff --git a/fixtures/people.com/1481580462922.html b/fixtures/people.com/1481580462922.html new file mode 100644 index 000000000..be10fa05d --- /dev/null +++ b/fixtures/people.com/1481580462922.html @@ -0,0 +1,6 @@ + Jennifer Aniston on Leaving the Tags on Her Coat

People

Stay Connected

Subscribe

Advertise With Us

Learn More

Skip to content

Fashion

Jennifer Aniston on Leaving the Tags on Her Céline Coat: 'I Wore It Four Times and Didn't Notice!'

Updated

People who don’t chronicle every item of clothing worn by the rich and famous for a profession probably don’t know this, but one of the major perks of being a celebrity is having luxe pieces “gifted” to you. As in the brands lend their clothing and accessories to A-list stars in the hopes that the press generated by it will help their sales and their prestige, which should explain why you regularly see every Kardashian clad in ensembles that literally came straight off the runway. It should also explain how Jennifer Aniston found herself on the red carpet of a film premiere wearing a jacket that still had a handful of price tags firmly attached, an event she was happy to finally set the record straight about on Thursday night’s Jimmy Kimmel Live!

AKM-GSI

During the actress’s appearance on the late night talk show, Kimmel asked her about a particular photo from the screening of her new movie Office Christmas Party in New York in which you can see some large, white price tags affixed to the interior of her Céline jacket, saying, “I can’t imagine how this happens to you.” Aniston replied, “Well, here’s the sad part of that story, I’ve worn that coat about four times.” The host quipped, “isn’t that against the rules of Hollywood?” to which she replied, “apparently.” She continued, “I wore it at least four times, it was very sweetly gifted to me from a commercial that I had just shot. So I wore it home and I didn’t think about it at all, to be honest. And yeah, four wears later and this happened, and it’s not like it’s even a light tag!” At which point the late night host insisted, “you stole that coat didn’t you?”

RELATED PHOTOS: Jennifer Aniston’s Beautiful Backyard Wedding

While this particular article of clothing was not in fact swiped, Aniston did admit to having stolen some items in her youth. When asked what she took, the actress authoritatively stated, “Beads. From a bead shop. Like when you made bead necklaces when you were 8.” She explained, “I was with my friend Monique, we were walking home, we weren’t with our parents at eight years old so that tells you a lot. But so, they were just little and we thought we were awesome and we came home and laid them all out, just thinking about all of the necklaces we were going to make, and then her mom walked in. I mean, we weren’t hiding it like you would if you’d stolen something, we weren’t smart thieves. So then we had to go back and personally return the beads.” And clearly, the whole debacle taught her a lesson as she never stole anything again. But really, who needs to steal when everything is gifted?

What do you think of Aniston’s minor wardrobe snafu? Has this ever happened to you? Sound off below!

\ No newline at end of file diff --git a/src/extractors/custom/index.js b/src/extractors/custom/index.js index 7a9698c71..8e9386452 100644 --- a/src/extractors/custom/index.js +++ b/src/extractors/custom/index.js @@ -30,3 +30,4 @@ export * from './www.sbnation.com'; export * from './www.bloomberg.com'; export * from './www.bustle.com'; export * from './www.vox.com'; +export * from './people.com'; diff --git a/src/extractors/custom/people.com/index.js b/src/extractors/custom/people.com/index.js new file mode 100644 index 000000000..2c7fa7ab3 --- /dev/null +++ b/src/extractors/custom/people.com/index.js @@ -0,0 +1,45 @@ +export const PeopleComExtractor = { + domain: 'people.com', + + title: { + selectors: [ + ['meta[name="og:title"]', 'value'], + ], + }, + + author: { + selectors: [ + 'a.author.url.fn', + ], + }, + + date_published: { + selectors: [ + ['meta[name="article:published_time"]', 'value'], + ], + }, + + lead_image_url: { + selectors: [ + ['meta[name="og:image"]', 'value'], + ], + }, + + content: { + selectors: [ + 'div.article-body__inner', + ], + + // 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: [ + + ], + }, +}; diff --git a/src/extractors/custom/people.com/index.test.js b/src/extractors/custom/people.com/index.test.js new file mode 100644 index 000000000..cd9b0fef9 --- /dev/null +++ b/src/extractors/custom/people.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('PeopleComExtractor', () => { + describe('initial test case', () => { + let result; + let url; + beforeAll(() => { + url = + 'http://people.com/style/jennifer-aniston-coat-tags-jimmy-kimmel/'; + const html = + fs.readFileSync('./fixtures/people.com/1481580462922.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/people.com/index.js. + const { title } = await result; + + // Update these values with the expected values from + // the article. + assert.equal(title, 'Jennifer Aniston on Leaving the Tags on Her Celine Coat: ‘I Wore It Four Times and Didn’t Notice!’'); + }); + + it('returns the author', async () => { + // To pass this test, fill out the author selector + // in ./src/extractors/custom/people.com/index.js. + const { author } = await result; + + // Update these values with the expected values from + // the article. + assert.equal(author, 'Emily Kirkpatrick'); + }); + + it('returns the date_published', async () => { + // To pass this test, fill out the date_published selector + // in ./src/extractors/custom/people.com/index.js. + const { date_published } = await result; + + // Update these values with the expected values from + // the article. + assert.equal(date_published, '2016-12-09T15:40:20.000Z'); + }); + + it('returns the lead_image_url', async () => { + // To pass this test, fill out the lead_image_url selector + // in ./src/extractors/custom/people.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://i2.wp.com/peopledotcom.files.wordpress.com/2016/12/jennifer-aniston5.jpg?crop=0px%2C0px%2C1500px%2C1125px&resize=660%2C495&ssl=1'); + }); + + it('returns the content', async () => { + // To pass this test, fill out the content selector + // in ./src/extractors/custom/people.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, 'People who don’t chronicle every item of clothing worn by the rich and'); + }); + }); +});