From 2279c2d4868eb26439a4d4ccd314df4d964a2af8 Mon Sep 17 00:00:00 2001 From: Janet Date: Wed, 8 Feb 2017 17:01:55 -0500 Subject: [PATCH] feat: natgeo parser (#89) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: natgeo parser Same as the news.nationalgeographic.com parser - for some reason the author name doesn’t appear to be getting pulled into the local copy of the file. * fix: content assertion * fix: generalize author byline * disable: author assertion * rm: author assertion * fix: image lead, handles image-group * fix: guard agaist missing img url * fix: generalize dek and title selectors --- .../1481921323654.html | 3 + src/extractors/custom/index.js | 1 + .../www.nationalgeographic.com/index.js | 75 ++++++++++++++++ .../www.nationalgeographic.com/index.test.js | 87 +++++++++++++++++++ 4 files changed, 166 insertions(+) create mode 100644 fixtures/www.nationalgeographic.com/1481921323654.html create mode 100644 src/extractors/custom/www.nationalgeographic.com/index.js create mode 100644 src/extractors/custom/www.nationalgeographic.com/index.test.js diff --git a/fixtures/www.nationalgeographic.com/1481921323654.html b/fixtures/www.nationalgeographic.com/1481921323654.html new file mode 100644 index 000000000..eba962349 --- /dev/null +++ b/fixtures/www.nationalgeographic.com/1481921323654.html @@ -0,0 +1,3 @@ + How Today's Toys May Be Harming Your Daughter
arrow-downarrow-leftarrow-rightarrow-upavatarcameracartchevron-upchevron-leftchevron-rightchevron-upclosecommentemailfullscreen-closefullscreen-opengridheadphonesheart-filledheart-openlockmap-geolocatormap-pushpinArtboard 1Artboard 1Artboard 1minusng-borderpauseplayplusprintArtboard 1sharefacebookgithubArtboard 1Artboard 1linkedinlinkedin_inpinterestpinterest_psnapchatsnapchat_2tumblrtwittervimeovinewhatsappspeakerstar-filledstar-openzoom-inzoom-out

Gender Revolution

How Today's Toys May Be Harming Your Daughter

The long history of separate toys for girls and boys shows that marketing by gender has a profound impact on children.

This story appears in the January 2017 issue of National Geographic magazine. Read the print version in stores December 27, purchase a copy by mail by calling 1-800-777-2800, or come back to read the full digital version of the issue online on December 19.

For adults, play is a break from life. For children, especially in the earliest stages of childhood development, play is life, and toys are the tools of early learning.

That includes lessons about gender. American society has made significant strides towards gender equality over the past century, but children’s toys seem to be moving in the opposite direction, reinforcing traditional roles rather than expanding them. The implications are serious: The way girls play may affect how their brains develop.

There’s a long history of marketing toys by gender. Sociologist Elizabeth Sweet, at the California State University, Sacramento, analyzed more than 7,300 toys in Sears catalogs from the 20th century. She discovered that gender-based toy ads from the 1920s to the 1950s pushed traditional roles: the “little homemaker”; the “young man of industry.” In 1925, about half the toys in the Sears catalog were marketed explicitly to either boys or girls. Many toy advertisements appealed to boys as “young entrepreneurs,” with a sales pitch to use on their parents. In 1945, with World War II winding down and many women leaving factories for domestic life, Sweet says toys were “overwhelmingly targeted at girls in a very explicit way: your little girl will love this dish set!”

It was not always this way. With the second-wave feminist movement in full swing, the 1970s saw a near-elimination of gendered toys: Only 2 percent of toys in the 1975 Sears catalog were marketed explicitly to boys or girls. Even the small fraction of gender-specific toys—Barbie, for example—were mostly outfitted in primary, gender-neutral colors: red, yellow, blue.

But in the 1980s, gender distinctions resurged in children’s goods, especially clothing. Marketers may have seen an opportunity as ultrasound technology became widely available, says Sweet, and parents could learn the sex of their babies before birth.

It also became easier to reach kids. In the 1970s, regulations limited toy companies’ ability to advertise directly to children on television, but deregulation under the Reagan Administration dismantled those protections in 1984. Toys and children’s entertainment became heavily intertwined, and manufacturers developed shows based on toys—like My Little Pony and Transformers—that followed niche-marketing wisdom by appealing to just one gender, says Sweet. It was a boon for the toy business: By December 1985, nine out of the 10 best-selling toys were linked to television shows, according to Diane Levin, a professor of education at Wheelock College in Boston.

The onslaught of gender-based marketing has only become more pronounced. A recent study by Carol Auster, a sociologist at Franklin & Marshall College in Pennsylvania, examined the retail website of Disney, one of the most powerful children's tastemakers, and saw that every single toy was categorized as either “girl toys” or “boy toys.” Those toys that were cross-listed for both boys and girls were all of a color scheme more traditionally associated with boys: blue, green, red, gray. Even for ostensibly gender-neutral children’s toys, masculine gender coding seems to be the default.

This is because girls have leeway in American society that boys do not. “We’ve really defined a much narrower role of what counts as masculinity,” Auster says. “ ‘Tomboy’ can mean anything from neutral to great. ‘Sissy’ is not meant in a positive way among kids.” Children and parents alike often police masculinity in ways that can magnify gender distinctions in toys, she explains; it’s hard to sell a boy a pink and purple play kitchen.

Even for ostensibly gender-neutral children’s toys, masculine gender coding seems to be the default.

Targeting toys by gender has consequences beyond socialization. A 2015 study found that boys are more likely to play with toys that develop spatial intelligence—K’nex, puzzles, Lego bricks—than girls are. Marketing can certainly play a role, says study author Jamie Jirout, a developmental psychologist at the University of Virginia. The girl-oriented product line Lego Friends focuses on playacting rather than construction; aisles in some toy stores distinguish “building sets” from “girls’ building sets.”

Boys also appear to play differently. According to a 2012 study by Susan Levine, a professor of education and psychology at the University of Chicago, boys opt to play with more complex puzzles—and get more spatially related encouragement from their parents. Parents are more likely to use words that foster spatial thinking—tall, big, edge, top, and bottom—when their children play with more challenging puzzles.

These distinctions may shape later life: “Spatial skills are a piece of the explanation for the underrepresentation of women in science and tech,” says Jirout. Informal activities like play are key to developing spatial skills, which, she says, are “not only important for math and science but for what we call ‘executive function’—higher level thinking.” Being comfortable with certain types of toys may also shape kids’ confidence in specific subjects, adds Auster.

There are signs things may be changing. Major toy retailers from Target to Walmart to Amazon are de-emphasizing gender labeling of toys. Even the oldest toy store in the world—Hamley's in the U.K., which dates back to 1750—dropped gender labeling in 2012.

Yet the toys themselves remain heavily split, the gender roles reminiscent of those pushed on kids in 1925, but more fantastical: The homemaker is the princess; the carpenter, the action hero.

"You take the pink backdrop down, but it's still a pink aisle," Sweet says of the toy sections of retail stores. In the risk-averse toy industry, where developing and marketing toys by gender is a reliable approach, companies like Hasbro divide their products into boy and girl categories on their annual reports.

Ultimately, it may be up to parents to bridge the gender divide. “Their biased views and their stereotypes might be influencing children,” says Jirout. “Girls don’t necessarily care about the color of their toys.”

Editor's note: The headline has been changed to better reflect the research described in the story.

Natasha Daly is an assistant editor at National Geographic. Follow her on Twitter.

Comment on This Story



Events

Hear live stories from explorers and photographers around the country.

See Locations Near You

Exhibits

Enjoy a variety of exhibitions that reflect the richness and diversity of our world.

Buy Tickets

\ No newline at end of file diff --git a/src/extractors/custom/index.js b/src/extractors/custom/index.js index 0e0a55b51..c78256e0e 100644 --- a/src/extractors/custom/index.js +++ b/src/extractors/custom/index.js @@ -37,6 +37,7 @@ export * from './www.reuters.com'; export * from './mashable.com'; export * from './www.chicagotribune.com'; export * from './www.vox.com'; +export * from './www.nationalgeographic.com'; export * from './www.latimes.com'; export * from './pagesix.com'; export * from './thefederalistpapers.org'; diff --git a/src/extractors/custom/www.nationalgeographic.com/index.js b/src/extractors/custom/www.nationalgeographic.com/index.js new file mode 100644 index 000000000..5f1763d01 --- /dev/null +++ b/src/extractors/custom/www.nationalgeographic.com/index.js @@ -0,0 +1,75 @@ +export const WwwNationalgeographicComExtractor = { + domain: 'www.nationalgeographic.com', + + title: { + selectors: [ + 'h1', + 'h1.main-title', + ], + }, + + author: { + selectors: [ + '.byline-component__contributors b span', + ], + }, + + date_published: { + selectors: [ + ['meta[name="article:published_time"]', 'value'], + ], + }, + + dek: { + selectors: [ + '.article__deck', + ], + }, + + lead_image_url: { + selectors: [ + ['meta[name="og:image"]', 'value'], + ], + }, + + content: { + selectors: [ + ['.parsys.content', '.__image-lead__'], + '.content', + ], + + // Is there anything in the content you selected that needs transformed + // before it's consumable content? E.g., unusual lazy loaded images + transforms: { + '.parsys.content': ($node, $) => { + const $imageParent = $node.children().first(); + if ($imageParent.hasClass('imageGroup')) { + const $dataAttrContainer = $imageParent.find('.media--medium__container').children().first(); + const imgPath1 = $dataAttrContainer.data('platform-image1-path'); + const imgPath2 = $dataAttrContainer.data('platform-image2-path'); + if (imgPath2 && imgPath1) { + $node.prepend($(`
+ + +
`)); + } + } else { + const $imgSrc = $node.find('.image.parbase.section') + .find('.picturefill') + .first() + .data('platform-src'); + if ($imgSrc) { + $node.prepend($(``)); + } + } + }, + }, + + // Is there anything that is in the result that shouldn't be? + // The clean selectors will remove anything that matches from + // the result + clean: [ + '.pull-quote.pull-quote--small', + ], + }, +}; diff --git a/src/extractors/custom/www.nationalgeographic.com/index.test.js b/src/extractors/custom/www.nationalgeographic.com/index.test.js new file mode 100644 index 000000000..7edbdf147 --- /dev/null +++ b/src/extractors/custom/www.nationalgeographic.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('WwwNationalgeographicComExtractor', () => { + describe('initial test case', () => { + let result; + let url; + beforeAll(() => { + url = + 'http://www.nationalgeographic.com/magazine/2017/01/gender-toys-departments-piece/'; + const html = + fs.readFileSync('./fixtures/www.nationalgeographic.com/1481921323654.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.nationalgeographic.com/index.js. + const { title } = await result; + + // Update these values with the expected values from + // the article. + assert.equal(title, 'How Today\'s Toys May Be Harming Your Daughter'); + }); + + it('returns the date_published', async () => { + // To pass this test, fill out the date_published selector + // in ./src/extractors/custom/www.nationalgeographic.com/index.js. + const { date_published } = await result; + + // Update these values with the expected values from + // the article. + assert.equal(date_published, '2016-12-15T16:39:00.000Z'); + }); + + it('returns the dek', async () => { + // To pass this test, fill out the dek selector + // in ./src/extractors/custom/www.nationalgeographic.com/index.js. + const { dek } = await result; + + // Update these values with the expected values from + // the article. + assert.equal(dek, 'The long history of separate toys for girls and boys shows that marketing by gender has a profound impact on children.'); + }); + + it('returns the lead_image_url', async () => { + // To pass this test, fill out the lead_image_url selector + // in ./src/extractors/custom/www.nationalgeographic.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://www.nationalgeographic.com/content/dam/magazine/rights-exempt/2017/01/Departments/gendertoys/gendertoysOG.ngsversion.1481823676336.png'); + }); + + it('returns the content', async () => { + // To pass this test, fill out the content selector + // in ./src/extractors/custom/www.nationalgeographic.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, 'This story appears in the January 2017 issue of National Geographic magazine. Read'); + }); + }); +});