Skip to content

Commit

Permalink
Merge pull request #329 from evanxd/bug-1142312
Browse files Browse the repository at this point in the history
Bug 1142312 - Add two more types of unlikely candidates: cover-wrap and yom-remote, r=Gijs
  • Loading branch information
evanxd committed Dec 15, 2016
2 parents 4a0d08c + 63230a3 commit c83826c
Show file tree
Hide file tree
Showing 4 changed files with 14,996 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Readability.js
Expand Up @@ -112,7 +112,7 @@ Readability.prototype = {
// All of the regular expressions in use within readability.
// Defined up here so we don't instantiate them repeatedly in loops.
REGEXPS: {
unlikelyCandidates: /banner|combx|comment|community|disqus|extra|foot|header|legends|menu|modal|related|remark|rss|shoutbox|sidebar|skyscraper|sponsor|ad-break|agegate|pagination|pager|popup/i,
unlikelyCandidates: /banner|combx|comment|community|cover-wrap|disqus|extra|foot|header|legends|menu|modal|related|remark|rss|shoutbox|sidebar|skyscraper|sponsor|ad-break|agegate|pagination|pager|popup|yom-remote/i,
okMaybeItsACandidate: /and|article|body|column|main|shadow/i,
positive: /article|body|content|entry|hentry|h-entry|main|page|pagination|post|text|blog|story/i,
negative: /hidden|^hid$| hid$| hid |^hid |banner|combx|comment|com-|contact|foot|footer|footnote|masthead|media|meta|modal|outbrain|promo|related|scroll|share|shoutbox|sidebar|skyscraper|sponsor|shopping|tags|tool|widget/i,
Expand Down
6 changes: 6 additions & 0 deletions test/test-pages/yahoo-3/expected-metadata.json
@@ -0,0 +1,6 @@
{
"title": "Veteran Wraps Baby in American Flag, Photo Sparks Controversy",
"byline": "By GILLIAN MOHNEY\n March 11, 2015 3:46 PM",
"excerpt": "From Yahoo: A photographer and Navy veteran is fighting back after a photo she posted to Facebook started an online backlash. Vanessa Hicks said she had no idea her photo would be considered controversial. The photo, from a military family’s newborn photo shoot, showed a newborn infant wrapped in an American flag held by his father, who was in his military uniform. Hicks, a Navy veteran herself and the wife of an active-duty Navy member, said her intention was to honor the flag as well as her clients, who wanted to incorporate their military service in the photo shoot.",
"readerable": true
}
40 changes: 40 additions & 0 deletions test/test-pages/yahoo-3/expected.html
@@ -0,0 +1,40 @@
<div id="readability-page-1" class="page">
<div id="Main" tabindex="0" class="Pos-r Z-3 Stack yog-card yog-content" role="main">
<section class="yom-mod yom-breaking-news level2" id="mediacontentbreakingnews" data-ylk="mid:mediacontentbreakingnews;mpos:1;t1:a3;t2:mod-bkn;sec:mod-bkn;">
<p class="hd"> <span>'GMA' Cookie Search:</span> </p>
</section>
<section id="mediacontentstory" class="yom-mod yom-card-main yom-article" data-uuid="4250eebf-bbb0-3c95-8fd0-3cb4d3daf93c" data-type="story" data-ylk="t1:a3;t2:ct-mod;sec:ct-mod;itc:0;rspns:nav;">
<div class="book clearfix">
<div class="body yom-art-content clearfix" itemscope="" itemtype="https://schema.org/Article">
<meta itemprop="datePublished" content="2015-03-11T19:46:14Z" />
<meta itemprop="headline" content="Veteran Wraps Baby in American Flag, Photo Sparks Controversy" />
<meta itemprop="alternativeHeadline" content="" />
<meta itemprop="image" content="https://media.zenfs.com/en-US/video/video.abcnewsplus.com/559ecdbafdb839129816b5c79a996975" />
<meta itemprop="description" content="A photographer and Navy veteran is fighting back after a photo she posted to Facebook started an online backlash. Vanessa Hicks said she had no idea her photo would be considered controversial. The photo, from a military family’s newborn photo shoot, showed a newborn infant wrapped in an American flag held by his father, who was in his military uniform. Hicks, a Navy veteran herself and the wife of an active-duty Navy member, said her intention was to honor the flag as well as her clients, who wanted to incorporate their military service in the photo shoot." />
<p>A photographer and Navy veteran is fighting back after a photo she posted to <a id="ramplink_Facebook_" href="http://abcnews.go.com/topics/business/companies/facebook-inc.htm" target="_blank" data-rapid_p="13">Facebook</a> started an online backlash.</p>
<p>Vanessa Hicks said she had no idea her photo would be considered controversial. The photo, from a military family’s newborn photo shoot, showed a newborn infant wrapped in an American flag held by his father, who was in his military uniform.</p>
<p>Hicks, a Navy veteran herself and the wife of an active-duty Navy member, said her intention was to honor the flag as well as her clients, who wanted to incorporate their military service in the photo shoot.</p>
<p><a href="http://abcnews.go.com/WNT/video/pizza-patriots-making-special-super-bowl-delivery-troops-28633975" target="_blank" data-rapid_p="14">Pizza Man Making Special Delivery Pizza Delivery to Afghanistan During Super Bowl</a></p>
<p><a href="http://abcnews.go.com/Health/superbug-scope-maker-altered-design-make-cleaning-easier/story?id=29417816" target="_blank" data-rapid_p="15">Redesigned Scopes Fail to Stop 'Superbug Outbreaks</a></p>
<p><a href="http://abcnews.go.com/Travel/video/antarctica-penguin-post-office-job-attracts-record-number-29247380" target="_blank" data-rapid_p="16">Antarctica 'Penguin Post Office' Attracts Record Number of Applicants</a></p>
<p>“This is what he was fighting for, his son wrapped in an American flag,” Hicks told ABC News. However, when she posted the image on her page, she started to get comments accusing her of desecrating the flag.</p>
<p>On one Facebook page an unidentified poster put up her picture writing and wrote they found it was “disrespectful, rude, tacky, disgusting, and against the U.S. Flag Code.”</p>
<div class="yom-fig-frame"><span id="schemaorg"><div class="yom-figure yom-fig-middle"><figure class="cover get-lbdata-from-dom go-to-slideshow-lightbox" data-orig-index="2"> <a class="cover-anchor" name="cover-c9b69c1a26e19ae9fe744763dc31e9ac" id="cover-c9b69c1a26e19ae9fe744763dc31e9ac" data-rapid_p="17"></a><img alt="Vanessa Hicks" class="editorial lzbg" data-preembed="image" src="https://s3.yimg.com/bt/api/res/1.2/GNtA09EDJWzWfpBzGYJS0Q--/YXBwaWQ9eW5ld3NfbGVnbztxPTg1O3c9NjMw/http://media.zenfs.com/en_us/gma/us.abcnews.gma.com/HT_flag_baby_jtm_150311_16x9_992.jpg" title="Vanessa Hicks" width="630"/></figure><p class="legend">Vanessa Hicks</p></div>
</span></div>
<p style="display: inline;" class="readability-styled">The Federal Flag Code has guidelines for the proper treatment of the U.S. Flag but there are no rules for punishment related to violations. In the past, the </p><a href="http://abcnews.go.com/topics/news/us/supreme-court.htm" target="_blank" data-rapid_p="18">Supreme Court</a>
<p style="display: inline;" class="readability-styled"> has found that people are protected from punishment under the First Amendment for manipulating or even burning the flag.
</p>
<p>Hicks said she was surprised when messages suddenly started to pop up on her Facebook page and even her own website criticizing her photos.</p>
<p>She said she stayed up until 4 a.m. recently to take down comments from her business and company page, even on shoots that had nothing to do with the flag.</p>
<p>“I know how low I felt during those first few hours,” said Hicks. “[I felt] am I not a good American or veteran or wife. It’s a train-wreck you can’t help but watch.”</p>
<p>As Hicks tried to stop the comments from taking over her pages, others started to take notice and her picture went viral on social media sites. After that, Hicks found that many people, both military and civilian, told her they did not find the picture offensive.</p>
<p>“I have seen first-hand what is desecration of the flag,” Hicks said of her time in the military. “At the end of the day I didn’t do anything that disrespected this flag.”</p>
<p>Hicks, whose husband is still on active duty in the Navy, said the flag is a symbol of U.S. freedoms including the First Amendment right to free speech.</p>
<p>“[My husband] wouldn’t die for a flag, he would die for the freedoms that this country offers,” she told ABC News.</p>
<p>After her story grabbed local headlines, Hicks has been inundated by requests for photos shoots, and she said she plans to give 15 percent of all profits related to these shoots to the USO.</p>
</div>
</div>

</section>
</div>
</div>

0 comments on commit c83826c

Please sign in to comment.