This commit is contained in:
Adam Pash 2016-09-07 11:22:54 -04:00
parent ac62e0fba0
commit 189361dc20
4 changed files with 5 additions and 8 deletions

View File

@ -2,8 +2,6 @@ import assert from 'assert'
import cheerio from 'cheerio' import cheerio from 'cheerio'
import fs from 'fs' import fs from 'fs'
// import HTML from './fixtures/html'
import extractCleanNode from './extract-clean-node' import extractCleanNode from './extract-clean-node'
import extractBestNode from './extract-best-node' import extractBestNode from './extract-best-node'
@ -21,14 +19,14 @@ describe('extractCleanNode(article, $, { cleanConditionally })', () => {
const bestNode = extractBestNode($, opts) const bestNode = extractBestNode($, opts)
let result = $.html(bestNode) let result = $.html(bestNode)
// console.log(result) // console.log(result)
console.log(result.length) // console.log(result.length)
const cleanNode = extractCleanNode(bestNode, $, opts) const cleanNode = extractCleanNode(bestNode, $, opts)
result = $.html(cleanNode) result = $.html(cleanNode)
console.log(result.length) // console.log(result.length)
// console.log(result) // console.log(result)
// console.log(bestNode.html()) // console.log(bestNode.html())
// assert.equal($(bestNode).text().length, 3652) assert.equal($(bestNode).text().length, 3652)
}) })
}) })

View File

@ -6,7 +6,7 @@ describe('Iris', function() {
it('does the whole thing', async function() { it('does the whole thing', async function() {
const result = await Iris.parse('http://theconcourse.deadspin.com/phyllis-schlafly-finally-croaks-1786219220') const result = await Iris.parse('http://theconcourse.deadspin.com/phyllis-schlafly-finally-croaks-1786219220')
console.log(result) // console.log(result)
}) })
}) })
}) })

View File

@ -9,7 +9,7 @@ describe('Resource', () => {
const url = 'http://theconcourse.deadspin.com/1786177057' const url = 'http://theconcourse.deadspin.com/1786177057'
const $ = await Resource.create(url) const $ = await Resource.create(url)
console.log($.html()) // console.log($.html())
}) })
}) })

View File

@ -1 +0,0 @@
<div><div id="area-article-first-block" cla ="area" score="48.25"><div id="mod-a-body-first-para" class="mod-latarticlesarticletext mod-articletext" score="56.875"><p score="3.5">SACRAMENTO &#x2014; The influential lobby group Consumer Electronics Assn. is fighting what appears to be a losing battle to dissuade California regulators from passing the nation&apos;s first ban on energy-hungry big-screen televisions.</p><p score="7">On Tuesday, executives and consultants for the Arlington, Va., trade group asked members of the California Energy Commission to instead let consumers use their wallets to decide whether they want to buy the most energy-saving new models of liquid-crystal display and plasma high-definition TVs.</p><p score="7">&quot;Voluntary efforts are succeeding without regulations,&quot; said Doug Johnson, the association&apos;s senior director for technology policy. Too much government interference could hamstring industry innovation and prove expensive to manufacturers and consumers, he warned.</p><p score="4">But those pleas didn&apos;t appear to elicit much support from commissioners at a public hearing on the proposed rules that would set maximum energy-consumption standards for televisions to be phased in over two years beginning in January 2011. A vote could come as early as Nov. 4.</p></div></div><div id="mod-a-body-after-first-para" class="mod-latarticlesarticletextwithadcpc mod-latarticlesarticletext mod-articletext" score="109.725"><p score="6">The association&apos;s views weren&apos;t shared by everyone in the TV business. Representatives of some TV makers, including top-seller Vizio Inc. of Irvine, said they would have little trouble complying with tighter state standards without substantially increasing prices.</p><p score="4.02">&quot;We&apos;re comfortable with our ability to meet the proposed levels and implementation dates,&quot; said Kenneth R. Lowe, Vizio&apos;s co-founder and vice president.</p><p score="5.64">Last month, the commission formally unveiled its proposal to require manufacturers to limit television energy consumption in a way that has been done with refrigerators, air conditioners and dozens of other products since the 1970s.</p><p score="7">&quot;We would not propose TV efficiency standards if we thought there was any evidence in the record that they will hurt the economy,&quot; said Commissioner Julia Levin, who has been in charge of the two-year rule-making procedure. &quot;This will actually save consumers money and help the California economy grow and create new clean, sustainable jobs.&quot;</p><p score="5.04">Tightening efficiency ratings by using new technology and materials should result in &quot;zero increase in cost to consumers,&quot; said Harinder Singh, an Energy Commission staffer on the TV regulation project.</p><p score="5">California&apos;s estimated 35 million TVs and related electronic devices account for about 10% of all household electricity consumption, the Energy Commission staff reported. But manufacturers quickly are coming up with new technologies that are making even 50-inch-screen models much more economical to operate.</p><p score="7.88">New features, such as light-emitting diodes that consume tiny amounts of power, special reflective films and sensors that automatically adjust TV brightness to a room&apos;s viewing conditions, are driving down electricity consumption, experts said.</p><p score="6.2">The payoff could be big for TV owners, said Ken Rider, a commission staff engineer. Average first-year savings from reduced electricity use would be an estimated $30 per set and $912 million statewide, he said.</p><p score="7">If all TVs met state standards, Rider added, California could avoid the $600-million cost of building a natural-gas-fired power plant. Switching to more-efficient TVs could have an estimated net benefit to the state of $8.1 billion, the commission staff reported.</p><p score="10">Consumer Electronics Assn. officials disputed that figure, arguing that it was based on out-of-date numbers that fail to account for recent industry innovations. &quot;With voluntary compliance, manufacturers can meet the targets over time, managing the cost impact, yet not in any way impeding innovation,&quot; said Seth Greenstein, an association consultant.</p><p score="0">--</p><p score="0"><a href="mailto:marc.lifsher@latimes.com">marc.lifsher@latimes.com</a></p></div></div>