Skip to content

Commit 00f8965

Browse files
authored
fix: cleaning up deks (#44)
We've solidified what we consider a dek. This PR removes the dek selectors that do not fit that mold.
1 parent b415d1d commit 00f8965

File tree

23 files changed

+0
-206
lines changed

23 files changed

+0
-206
lines changed

src/extractors/custom/fandom.wikia.com/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ export const WikiaExtractor = {
5151

5252
dek: {
5353
selectors: [
54-
['meta[name="og:description"]', 'value'],
5554
],
5655
},
5756

src/extractors/custom/www.apartmenttherapy.com/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ export const ApartmentTherapyExtractor = {
5353

5454
dek: {
5555
selectors: [
56-
['meta[name=description]', 'value'],
5756
],
5857
},
5958

src/extractors/custom/www.apartmenttherapy.com/index.test.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,6 @@ describe('CustomExtractor', () => {
6969
assert.equal(date_published, '2016-10-13T21:00:00.000Z');
7070
});
7171

72-
it('returns the dek', async () => {
73-
// To pass this test, fill out the dek selector
74-
// in ./src/extractors/custom/www.apartmenttherapy.com/index.js.
75-
const html =
76-
fs.readFileSync('./fixtures/www.apartmenttherapy.com/1476396697639.html');
77-
const articleUrl =
78-
'http://www.apartmenttherapy.com/a-light-filled-la-loft-236564';
79-
80-
const { dek } =
81-
await Mercury.parse(articleUrl, html, { fallback: false });
82-
83-
// Update these values with the expected values from
84-
// the article.
85-
assert.equal(dek, "Name: Ashley Location: Downtown — Los Angeles, California Welcome to our sunny and spacious downtown home located in the in the heart of Downtown LA's Historic Core. Inside you'll find a 1,300 square foot bi-level ground unit with loft (only three of its kind!) that offers an unparalleled, refined industrial, modern aesthetic.");
86-
});
87-
8872
it('returns the lead_image_url', async () => {
8973
// To pass this test, fill out the lead_image_url selector
9074
// in ./src/extractors/custom/www.apartmenttherapy.com/index.js.

src/extractors/custom/www.broadwayworld.com/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ export const BroadwayWorldExtractor = {
4747

4848
dek: {
4949
selectors: [
50-
['meta[name="og:description"]', 'value'],
5150
],
5251
},
5352

src/extractors/custom/www.broadwayworld.com/index.test.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,6 @@ describe('CustomExtractor', () => {
6969
assert.equal(date_published, '2016-10-13T19:35:00.000Z');
7070
});
7171

72-
it('returns the dek', async () => {
73-
// To pass this test, fill out the dek selector
74-
// in ./src/extractors/custom/www.broadwayworld.com/index.js.
75-
const html =
76-
fs.readFileSync('./fixtures/www.broadwayworld.com/1476392567143.html');
77-
const articleUrl =
78-
'http://www.broadwayworld.com/article/American-Theatre-Wing-Launches-Andrew-Lloyd-Webber-Training-Scholarships-20161013';
79-
80-
const { dek } =
81-
await Mercury.parse(articleUrl, html, { fallback: false });
82-
83-
// Update these values with the expected values from
84-
// the article.
85-
assert.equal(dek, 'The American Theatre Wing announced today that their Andrew Lloyd Webber Initiative has launched its second initiative program, the Training Scholarships, bridging the gap between talent and opportunity and creating a strong pipeline to the professional theatre for promising artists of all backgrounds.');
86-
});
87-
8872
it('returns the lead_image_url', async () => {
8973
// To pass this test, fill out the lead_image_url selector
9074
// in ./src/extractors/custom/www.broadwayworld.com/index.js.

src/extractors/custom/www.buzzfeed.com/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ export const BuzzfeedExtractor = {
5656

5757
dek: {
5858
selectors: [
59-
['meta[name="description"]', 'value'],
6059
],
6160
},
6261

src/extractors/custom/www.buzzfeed.com/index.test.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,6 @@ describe('BuzzfeedExtractor', () => {
6969
// // assert.equal(date_published, 'hi');
7070
// });
7171

72-
it('returns the dek', async () => {
73-
// To pass this test, fill out the dek selector
74-
// in ./src/extractors/custom/www.buzzfeed.com/index.js.
75-
const html =
76-
fs.readFileSync('./fixtures/www.buzzfeed.com/1475531975121.html');
77-
const articleUrl =
78-
'https://www.buzzfeed.com/ikrd/people-are-calling-out-this-edited-picture-of-demi-lovato-fo';
79-
80-
const { dek } =
81-
await Mercury.parse(articleUrl, html, { fallback: false });
82-
83-
// Update these values with the expected values from
84-
// the article.
85-
assert.equal(dek, 'Lovato said: "Is that how my boobs should look?"..');
86-
});
87-
8872
it('returns the lead_image_url', async () => {
8973
// To pass this test, fill out the lead_image_url selector
9074
// in ./src/extractors/custom/www.buzzfeed.com/index.js.

src/extractors/custom/www.cnn.com/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ export const WwwCnnComExtractor = {
2020
],
2121
},
2222

23-
dek: null,
24-
2523
lead_image_url: {
2624
selectors: [
2725
['meta[name="og:image"]', 'value'],

src/extractors/custom/www.cnn.com/index.test.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -66,22 +66,6 @@ describe('WwwCnnComExtractor', () => {
6666
assert.equal(date_published, '2016-11-29T10:39:35.000Z');
6767
});
6868

69-
it('returns the dek', async () => {
70-
// To pass this test, fill out the dek selector
71-
// in ./src/extractors/custom/www.cnn.com/index.js.
72-
const html =
73-
fs.readFileSync('./fixtures/www.cnn.com/1480458253239.html');
74-
const articleUrl =
75-
'http://www.cnn.com/2016/11/29/politics/donald-trump-transition-presidency/index.html';
76-
77-
const { dek } =
78-
await Mercury.parse(articleUrl, html, { fallback: false });
79-
80-
// Update these values with the expected values from
81-
// the article.
82-
assert.equal(dek, null);
83-
});
84-
8569
it('returns the lead_image_url', async () => {
8670
// To pass this test, fill out the lead_image_url selector
8771
// in ./src/extractors/custom/www.cnn.com/index.js.

src/extractors/custom/www.littlethings.com/index.test.js

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -53,38 +53,6 @@ describe('LittleThingsExtractor', () => {
5353
assert.equal(author, 'Laura Caseley');
5454
});
5555

56-
// it('returns the date_published', async () => {
57-
// // To pass this test, fill out the date_published selector
58-
// // in ./src/extractors/custom/www.littlethings.com/index.js.
59-
// const html =
60-
// fs.readFileSync('./fixtures/www.littlethings.com/1475605036506.html');
61-
// const articleUrl =
62-
// 'http://www.littlethings.com/diy-pineapple-lamp/';
63-
//
64-
// const { date_published } =
65-
// await Mercury.parse(articleUrl, html, { fallback: false });
66-
//
67-
// // Update these values with the expected values from
68-
// // the article.
69-
// assert.equal(date_published, '');
70-
// });
71-
72-
// it('returns the dek', async () => {
73-
// // To pass this test, fill out the dek selector
74-
// // in ./src/extractors/custom/www.littlethings.com/index.js.
75-
// const html =
76-
// fs.readFileSync('./fixtures/www.littlethings.com/1475605036506.html');
77-
// const articleUrl =
78-
// 'http://www.littlethings.com/diy-pineapple-lamp/';
79-
//
80-
// const { dek } =
81-
// await Mercury.parse(articleUrl, html, { fallback: false });
82-
//
83-
// // Update these values with the expected values from
84-
// // the article.
85-
// assert.equal(dek, '');
86-
// });
87-
8856
it('returns the lead_image_url', async () => {
8957
// To pass this test, fill out the lead_image_url selector
9058
// in ./src/extractors/custom/www.littlethings.com/index.js.

src/extractors/custom/www.msn.com/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ export const MSNExtractor = {
5151

5252
dek: {
5353
selectors: [
54-
['meta[name="description"]', 'value'],
5554
],
5655
},
5756

src/extractors/custom/www.msn.com/index.test.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,6 @@ describe('MSNExtractor', () => {
6969
assert.equal(date_published.split('T')[0], '2016-09-21');
7070
});
7171

72-
it('returns the dek', async () => {
73-
// To pass this test, fill out the dek selector
74-
// in ./src/extractors/custom/www.msn.com/index.js.
75-
const html =
76-
fs.readFileSync('./fixtures/www.msn.com/1475506925474.html');
77-
const articleUrl =
78-
'http://www.msn.com/en-us/health/wellness/this-is-your-brain-on-sad-movies-plus-5-films-to-cry-to/ar-BBwsPWG?li=BBnb2gg';
79-
80-
const { dek } =
81-
await Mercury.parse(articleUrl, html, { fallback: false });
82-
83-
// Update these values with the expected values from
84-
// the article.
85-
assert.equal(dek, 'The psychological reason why we love to watch sad movies is linked to the release of endorphins.');
86-
});
87-
8872
it('returns the lead_image_url', async () => {
8973
// To pass this test, fill out the lead_image_url selector
9074
// in ./src/extractors/custom/www.msn.com/index.js.

src/extractors/custom/www.newyorker.com/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ export const NewYorkerExtractor = {
4848

4949
dek: {
5050
selectors: [
51-
['meta[name="og:description"]', 'value'],
5251
],
5352
},
5453

src/extractors/custom/www.newyorker.com/index.test.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -68,22 +68,6 @@ describe('NewYorkerExtractor', () => {
6868
assert.equal(date_published, '2016-09-26T18:04:22.000Z');
6969
});
7070

71-
it('returns the dek', async () => {
72-
// To pass this test, fill out the dek selector
73-
// in ./src/extractors/custom/www.newyorker.com/index.js.
74-
const html =
75-
fs.readFileSync('./fixtures/www.newyorker.com/1475248565793.html');
76-
const articleUrl =
77-
'http://www.newyorker.com/tech/elements/hacking-cryptography-and-the-countdown-to-quantum-computing';
78-
79-
const { dek } =
80-
await Mercury.parse(articleUrl, html, { fallback: false });
81-
82-
// Update these values with the expected values from
83-
// the article.
84-
assert.equal(dek, 'In a decade, events like the recent data breach at Yahoo could become much more common, driven by a new kind of machine.');
85-
});
86-
8771
it('returns the lead_image_url', async () => {
8872
// To pass this test, fill out the lead_image_url selector
8973
// in ./src/extractors/custom/www.newyorker.com/index.js.

src/extractors/custom/www.politico.com/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ export const PoliticoExtractor = {
5454

5555
dek: {
5656
selectors: [
57-
['meta[name="description"]', 'value'],
5857
],
5958
},
6059

src/extractors/custom/www.politico.com/index.test.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,6 @@ describe('PoliticoExtractor', () => {
6969
assert.equal(date_published, '2016-10-04T09:07:00.000Z');
7070
});
7171

72-
it('returns the dek', async () => {
73-
// To pass this test, fill out the dek selector
74-
// in ./src/extractors/custom/www.politico.com/index.js.
75-
const html =
76-
fs.readFileSync('./fixtures/www.politico.com/1475617690069.html');
77-
const articleUrl =
78-
'http://www.politico.com/story/2016/10/who-will-win-the-vp-debate-229079?lo=ut_a1';
79-
80-
const { dek } =
81-
await Mercury.parse(articleUrl, html, { fallback: false });
82-
83-
// Update these values with the expected values from
84-
// the article.
85-
assert.equal(dek, '"Is it just me or are the two VP candidates infinitely more appealing than their running mates?" said a Pennsylvania Republican.');
86-
});
87-
8872
it('returns the lead_image_url', async () => {
8973
// To pass this test, fill out the lead_image_url selector
9074
// in ./src/extractors/custom/www.politico.com/index.js.

src/extractors/custom/www.theatlantic.com/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ export const TheAtlanticExtractor = {
4040

4141
lead_image_url: null,
4242

43-
dek: null,
44-
4543
next_page_url: null,
4644

4745
excerpt: null,

src/extractors/custom/www.washingtonpost.com/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ export const WwwWashingtonpostComExtractor = {
2222

2323
dek: {
2424
selectors: [
25-
['meta[name="og:description"]', 'value'],
2625
],
2726
},
2827

src/extractors/custom/www.washingtonpost.com/index.test.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -66,22 +66,6 @@ describe('WwwWashingtonpostComExtractor', () => {
6666
assert.equal(date_published, '2016-11-22T13:57:00.000Z');
6767
});
6868

69-
it('returns the dek', async () => {
70-
// To pass this test, fill out the dek selector
71-
// in ./src/extractors/custom/www.washingtonpost.com/index.js.
72-
const html =
73-
fs.readFileSync('./fixtures/www.washingtonpost.com/1480364838420.html');
74-
const articleUrl =
75-
'https://www.washingtonpost.com/politics/trump-foundation-apparently-admits-to-violating-ban-on-self-dealing-new-filing-to-irs-shows/2016/11/22/893f6508-b0a9-11e6-8616-52b15787add0_story.html';
76-
77-
const { dek } =
78-
await Mercury.parse(articleUrl, html, { fallback: false });
79-
80-
// Update these values with the expected values from
81-
// the article.
82-
assert.equal(dek, 'The foundation checked “yes” on the form for 2015 when asked whether it had transferred “income or assets to a disqualified person.”');
83-
});
84-
8569
it('returns the lead_image_url', async () => {
8670
// To pass this test, fill out the lead_image_url selector
8771
// in ./src/extractors/custom/www.washingtonpost.com/index.js.

src/extractors/custom/www.wired.com/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ export const WiredExtractor = {
5151

5252
dek: {
5353
selectors: [
54-
['meta[name="og:description"]', 'value'],
5554
],
5655
},
5756

src/extractors/custom/www.wired.com/index.test.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,6 @@ describe('WiredExtractor', () => {
6969
assert.equal(date_published, '2016-09-30T07:00:12.000Z');
7070
});
7171

72-
it('returns the dek', async () => {
73-
// To pass this test, fill out the dek selector
74-
// in ./src/extractors/custom/www.wired.com/index.js.
75-
const html =
76-
fs.readFileSync('./fixtures/www.wired.com/1475256747028.html');
77-
const articleUrl =
78-
'https://www.wired.com/2016/09/ode-rosetta-spacecraft-going-die-comet/';
79-
80-
const { dek } =
81-
await Mercury.parse(articleUrl, html, { fallback: false });
82-
83-
// Update these values with the expected values from
84-
// the article.
85-
assert.equal(dek, 'Time to break out the tissues, space fans.');
86-
});
87-
8872
it('returns the lead_image_url', async () => {
8973
// To pass this test, fill out the lead_image_url selector
9074
// in ./src/extractors/custom/www.wired.com/index.js.

src/extractors/custom/www.yahoo.com/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ export const YahooExtractor = {
5151

5252
dek: {
5353
selectors: [
54-
['meta[name="og:description"]', 'value'],
5554
// enter dek selectors
5655
],
5756
},

src/extractors/custom/www.yahoo.com/index.test.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,6 @@ describe('YahooExtractor', () => {
6969
assert.equal(date_published, '2016-10-03T05:00:00.000Z');
7070
});
7171

72-
it('returns the dek', async () => {
73-
// To pass this test, fill out the dek selector
74-
// in ./src/extractors/custom/www.yahoo.com/index.js.
75-
const html =
76-
fs.readFileSync('./fixtures/www.yahoo.com/1475529982399.html');
77-
const articleUrl =
78-
'https://www.yahoo.com/news/m/1c621104-b0eb-3b4d-9b0a-7bb979f80d7d/ss_clinton-cancels-joint-events.html';
79-
80-
const { dek } =
81-
await Mercury.parse(articleUrl, html, { fallback: false });
82-
83-
// Update these values with the expected values from
84-
// the article.
85-
assert.equal(dek, 'The Hillary Clinton campaign has canceled joint appearances with former primary opponent Bernie Sanders after he admitted that "of course" it bothered him that Clinton seemed to be talking down to his supporters in hacked audio from a fundraiser. The two were set to have joint appearance together Monday. Instead, Sanders will appear in both Iowa and Wisconsin on Monday to boost her candidacy without her. Clinton is now scheduled to swing through Iowa later in the week, but possibly without Sanders, who was asked on CNN\'s "State of the Union" if it bothered him that Clinton had referred to his younger supporters as "the children of the great recession" who "live in their parents\' basement" to');
86-
});
87-
8872
it('returns the lead_image_url', async () => {
8973
// To pass this test, fill out the lead_image_url selector
9074
// in ./src/extractors/custom/www.yahoo.com/index.js.

0 commit comments

Comments
 (0)