diff --git a/fixtures/arstechnica.com/1587927767738.html b/fixtures/arstechnica.com/1587927767738.html new file mode 100644 index 00000000..293ce90d --- /dev/null +++ b/fixtures/arstechnica.com/1587927767738.html @@ -0,0 +1,525 @@ + + + +The connected renter: How to make your apartment smarter | Ars Technica + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+
+ +
+
+

+ Tech — +

+

The connected renter: How to make your apartment smarter

+

Turning your rented space into a smart home can be tricky; we have some advice.

+
+ +
+
+ +
+ The connected renter: How to make your apartment smarter +
Valentina Palladino
+ + + + + + + +

+

Name a home appliance or product, and there's probably a smart version of it today. But for the renters among us, it can be tricky to navigate the aisles of smart light bulbs, thermostats, air conditioners, and vacuums to pick out devices that won't jeopardize your security deposit. When you don't own your home, there’s a different set of rules dictating modifications, and some smart home products don't take that into account.

+

Luckily these days, an increasing number of smart home devices can cater to apartment dwellers that want to avoid ripping open walls and trussing up wires. And as a NYC-based Ars staffer, I had a particularly perfect rental laboratory to recently test and explore what kinds of smart home devices fit renters' needs.

+

What protocols should/can you use?

+

When picking out accessories, for convenience's sake you'll probably want to decide ahead of time which of the many competing smart home ecosystems you'd like those products to come from. If you want to control all of your smart home products from the same app or want every product to be able to "talk" to each other, brand or protocol lock-in is the easiest current approach.

+

HomeKit

+

Let's start with the one everyone has heard of: HomeKit. Apple's IoT framework lets you control HomeKit-compatible devices via your iPhone or iPad. This framework tries to make it easier for users to control all smart home products by allowing the devices to talk to each other over a home's Wi-Fi network. With HomeKit, you can use Siri voice commands to control smart products—with iOS 10 in fact, an official "Home" app will make it easier to control HomeKit devices and group them together. After setting devices up, you can control them using simple phrases like, "Siri, turn off the living room lights." You can also make nuanced commands that control only certain devices. For example, the voice command "Good morning" could initiate a group of actions including turning on the bedroom and bathroom lights and opening the blinds.

+

The thing to remember about HomeKit is that manufacturers must integrate compatible hardware into their products under the terms of Apple's MFi licensing program . For example, a year or so ago Philips came out with a HomeKit-enabled Hue bridge for its smart lighting systems. The Philips Hue bridge already existed, but the company needed to make a new one that worked specifically with HomeKit. So far, companies including Belkin, Honeywell, and iHome among others have made HomeKit-ready devices. But still, the overall number of HomeKit-compatible devices is dwarfed by the number of smart home products available. HomeKit is also only available on Apple devices running iOS 8.2 or later, and watchOS 2 allows you to control devices via your Apple Watch.

+

Video shot/edited by Jennifer Hahn.

+

Alexa

+

Amazon's Alexa voice assistant is tied to Amazon's products, namely the Echo, and you can ask it questions about basically anything. Along the same lines as Siri, you can also control some smart home products by asking Alexa to turn things on and off. Through the Alexa mobile app, users can create batch commands similar to those available through Siri, and this option makes it possible to control entire rooms filled with devices. Unlike with Siri and HomeKit, though, manufacturers can create Alexa compatibility with software updates rather than implementing entirely new hardware—that's why companies like Nest and Haiku have been able to add Alexa support to their smart home products.

+

The convenience of HomeKit and Alexa is that you can control all of your devices using your voice—Alexa and Siri handle the communication from there. Otherwise, most smart home devices instead rely on dedicated apps that act like remote controls. HomeKit has the added benefit that devices can "talk" to one another, much like compatible devices under the Works with Nest framework. If, for example, you leave your home and lock your smart door lock behind you, that action could trigger turning off the lights inside a home.

+

Zigbee and Z-Wave

+

While HomeKit and Alexa have a lot of growing to do in terms of compatibility, Zigbee and Z-Wave have already linked to hundreds of working smart home devices. Both are mesh networking systems that send information between all devices on a network bound together by a hub. Zigbee runs on the universal 2.4GHz ISM frequency band, meaning its products are country-agnostic. By contrast, Z-Wave runs on the 915 MHz ISM band in the United States and the 868 MHz RFID band in the UK.

+

Both of these protocols, especially Zigbee, are suited for those who want to fiddle around with their devices and set unique commands and controls. However, keep in mind that hubs and devices on Zigbee and Z-Wave tend to have shorter ranges, meaning you'll need to keep individual devices relatively close to each other. For apartment dwellers, that might actually work to your advantage if you have only a few small rooms to connect.

+

Which products are off-limits?

+

The best way to know what can and can’t work within your rental is decidedly analogue—read your lease and any other renter's agreements you may have signed upon moving in. Check the official documentation to see what you have access to and what you don't. For example, my apartment came with a refrigerator, oven, and microwave, and my lease forbids me from installing any different ones without notifying the landlord's office first. I'm also not allowed to have washer or dryer units in my apartment. You don't want to buy any smart home product only to realize its installation or very existence violates your lease agreements.

+

As a general rule of thumb, smart thermostats are typically off-limits for renters. These products require rewiring stuff that's hidden behind walls, after all. Another category you'll want to be careful with is smart locks. Many (not all—we'll get to some examples) replace the locks on your doors, which renters typically cannot do without a specific reason or without informing management.

+ + +
+
+ + + + +
+
+ +
+
+ + + + + +
+
+ +
+ +
+
+ + +
+
+
+ + +
+ + + +
+
+ +
+
+

You must to comment.

+
+
+
+
+ +
+
+
+
+
+

Channel Ars Technica

+
+
+
+ +
+ +
+
+
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/fixtures/arstechnica.com/1587929444000.html b/fixtures/arstechnica.com/1587929444000.html new file mode 100644 index 00000000..6e9a4e1d --- /dev/null +++ b/fixtures/arstechnica.com/1587929444000.html @@ -0,0 +1,615 @@ + + + +Face masks for COVID-19: A deep dive into the data | Ars Technica + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+
+ +
+
+

+ Last resort — +

+

Face masks for COVID-19: A deep dive into the data

+

With all the talk of masks, here's what the data really says.

+
+ +
+
+ + + + + + +
Aurich Lawson / Getty
+

Filtration by N95 respirators, surgical masks, and homemade masks

+

N95 respirators get their name from their National Institute for Occupational Safety and Health (NIOSH) designation. They contain filter material that uses electrostatic attraction to thwart particles of all sizes. The N in the name means the masks are not resistant to oil and the 95 refers to their efficiency. To get a 95 designation, a mask has to filter out at least 95 percent of all particles. Specifically, the designation is granted if the mask proves to filter out at least 95 percent of particles in the size range it is least efficient at filtering out in standard conditions. This is considered “worst case” testing.

+

In one 2014 study, researchers compared the effectiveness of 44 masks, including N95 equivalent respirators, surgical and dental masks, general cotton masks, and handkerchiefs. They used particle penetration tests similar to those used by NIOSH and the European Union.

+

They found that the N95 equivalent mask blocked more than 95 percent of all particles, as expected. The surgical mask was around 40 percent effective, with the dental masks coming in at around 60 percent. Cotton masks were around 30 percent effective and cotton handkerchiefs ranged from 2 percent (one layer) to 13 percent (four layers).

+

A similar study in 2010 by NIOSH researchers looked at masks made of different types of fabrics. They found that masks made from t-shirts blocked about 10 percent of particles in a wide range, masks made from sweatshirt fabric blocked 20 to 40 percent, masks made from towels blocked around 40 percent, and scarves blocked 10 to 20 percent.

+

In a study published April 3, 2020 in Nature Medicine, researchers found that surgical masks reduced the detection of respiratory viruses in aerosols generated by infected people breathing or coughing in a breath-collecting machine.

+

Masks in the real world

+

Overall, the body of research on mask efficacy in real-world settings is small and scattershot. And because SARS-CoV-2 was completely unknown to humanity just five (extremely long) months ago, there is no data on the efficacy of any type of mask wearing in any setting (healthcare or home) for this virus.

+

As such, any relevant data has to be gleaned from studies looking at other respiratory illnesses and how various masks in various settings play a role.

+

Masks on healthy people

+

In a 2011 randomized clinical trial, researchers monitored 1,441 healthcare workers in 15 Beijing hospitals to compare the rates of respiratory infections if they wore either a surgical mask or an N95 respirator during their shifts. They compared infection rates in the two masked groups to a convenience sample of 481 healthcare workers who didn’t wear masks.

+

Overall, both masked groups had fewer respiratory symptoms, influenza-like illnesses, and confirmed viral infections than the control group. The rates of illness were approximately double in those who wore surgical masks compared with those who wore N95 respirators, though. For instance, about 9 percent of non-mask wearers reported respiratory symptoms compared with about 7 percent of surgical mask wearers and 4 percent of N95 wearers.

+

But with such small infection rates overall, there was limited power to detect differences, and the authors note that the findings may not hold up in other settings.

+
Dawn Canova, clinical manager for outpatient wound care at Carroll Hospital, takes samples from people to test them for the coronavirus at a drive-thru station in the hospital's parking garage while wearing a medical grade mask.
Enlarge / Dawn Canova, clinical manager for outpatient wound care at Carroll Hospital, takes samples from people to test them for the coronavirus at a drive-thru station in the hospital's parking garage while wearing a medical grade mask.
+

Masks on sick people

+

The push to preserve medical-grade masks for healthcare workers is intended to try to protect them from contracting illnesses from their patients. But the push for public face mask use is powered by the desire to prevent sick people from spraying respiratory droplets around and potentially sicken others.

+

This has become a greater concern as more evidence has pointed to apparent symptomless spread of COVID-19. That is, people who don’t show symptoms (either asymptomatic or pre-symptomatic) may be able to pass on the infection without knowing it. While there is evidence that this is happening in some cases, it’s still very unclear how often it happens. Estimates of how many cases are spreading stealthily like this have ranged from between 25 percent of cases to over 60 percent. Experts at the WHO, though, continue to say that people who are coughing or sneezing are still most likely to be the ones passing on the virus.

+

In a 2016 randomized controlled trial, researchers examined whether wearing a surgical mask could keep people with influenza-like illnesses (ILI) from passing the infection on to members of their household. Those household members were not asked to wear masks and the researchers didn’t collect data on it. The study included 123 ILI patients who were instructed to wear masks at home around other household members and 122 ILI patients who didn’t wear masks. The masked and unmasked ILI patients were in households with, on average, 2.5 or 2.4 members, respectively.

+

While the infection rates in home of masks-wearing patients were consistently lower than those in the homes of unmasked patients, the numbers were too small to be statistically significant.

+

“The study indicates a potential benefit of medical masks for source control but is limited by small sample size and low secondary attack rates [subsequent infections],” the authors concluded. “Larger trials are needed to confirm efficacy of medical masks as source control.”

+

Masks on everyone

+

With the new recommendations, everyone may be wearing masks, which has also been examined in a number of studies.

+

In 2008, a randomized controlled trial led by researchers in Hong Kong looked at the effect of blanket mask wearing on the spread of flu within households. They started with 198 households with one confirmed case at the beginning. Of those households, 127 were told that all household members should wear masks around each other. In 35 households, members were instructed to adhere to hand hygiene protocols and the remaining 36 households were controls.The researchers found little difference in infection spread among all three groups.

+

In 2009, researchers led by a group in Australia followed up with a similar randomized controlled study. The group looked at the spread of influenza-like illness to 286 adults in 143 households with a sick child. Participants were either assorted into a control group, a surgical mask group, or a more protective mask. Overall, they detected no difference in infection rates among the three groups. They noted that at least half of masked participants didn’t adhere to wearing the mask.

+

Another randomized controlled trial in 2009 followed people in 259 households in Hong Kong. Collectively, the households started with 407 household members with flu and 794 uninfected contacts. The households were randomly assorted to either all wear surgical masks, practice hand hygiene, or act as controls. Overall, the interventions didn’t lead to statistically significant differences in the spread of infections within the households. But when they looked at households that started using masks quickly (within 36 hours) after the onset of flu symptoms in a member, they did see a statistically significant reduction in infection spread.

+

Likewise, in a 2012 randomized controlled trial involving 84 households in Germany, researchers again found no difference in disease spread among household members that used masks, masks and hand hygiene, or were in a control group. However, when they did a separate analysis just looking at the households who fully implemented mask wearing or mask wearing and hygiene within 36 hours of onset of symptoms in their first case, they did note a lower chance of transmission than what was seen in controls.

+

Cloth masks

+

While most studies have looked at the effectiveness of surgical masks and other medical-grade masks, a few have ventured to look at cloth and homemade masks.

+

In a 2015 randomized controlled trial involving 1,607 healthcare workers, researchers compared the rate of influenza-like illness in healthcare workers wearing cloth masks or medical masks to those in a control group (which sometimes used masks). Wearing cloth masks resulted in significantly higher rates of infection, the authors found. They also noted that in their test, the cloth masks were only 3 percent effective at blocking particles.

+

Potential risks of masks

+

There is evidence that virus particles hang out on the outside of masks—particularly among healthcare workers who likely have high exposure. Among 59 healthcare workers who had their protective gear, clothes, and skin sampled in a 2019 study, many were contaminated with virus. Overall, 31 percent of gloves, 21 percent of gowns, and 12 percent of face masks were positive for virus. Moreover, 11 percent had viral particles on their scrubs and 7 percent had them on their bare faces.

+

A similar study, also in 2019, confirmed that respiratory viruses are often found on the outside surface of medical masks and can be a source of self-contamination.

+

In yet another study from last year, researchers in Chicago observed healthcare workers taking off their person protective equipment (masks, gloves, gowns, etc)—the removal is called doffing. This is a time when healthcare workers can easily self-contaminate by taking gear off incorrectly. The researchers found that healthcare workers incorrectly removed their protective gear 90 percent of the time.

+

If you do wear a mask, be sure to remove it from behind your head. Don’t touch the surface of the mask. If you do touch the surface, immediately wash your hands or use hand sanitizer.

+

Update 4/3/2020, 6:20pm ET: This post was updated to include the new federal recommendation for the public to wear cloth masks.

+ + +
+
+ + + + +
+
+ +
+
+ + + + + +
+
+ +
+ +
+
+ + +
+
+
+ + +
+ + + +
+
+ +
+
+

You must to comment.

+
+
+
+
+ +
+
+
+
+
+

Channel Ars Technica

+
+
+
+ +
+ +
+
+
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/extractors/collect-all-pages.js b/src/extractors/collect-all-pages.js index e15a3e4a..d33c423b 100644 --- a/src/extractors/collect-all-pages.js +++ b/src/extractors/collect-all-pages.js @@ -30,7 +30,6 @@ export default async function collectAllPages({ html, $, metaCache, - contentOnly: true, extractedTitle: title, previousUrls, }; diff --git a/src/extractors/custom/arstechnica.com/index.js b/src/extractors/custom/arstechnica.com/index.js new file mode 100644 index 00000000..7bfcf2cd --- /dev/null +++ b/src/extractors/custom/arstechnica.com/index.js @@ -0,0 +1,63 @@ +export const ArstechnicaComExtractor = { + domain: 'arstechnica.com', + + // Articles from this site are often paginated, but I was unable to write a CSS + // selector to find the next page. On the last page, there will be a link with a CSS + // selector indicating that the previous page is next. But the parser appears to find + // the next page without this extractor finding it, as long as the fallback option is + // left at its default value of true. + + title: { + selectors: ['title'], + }, + + author: { + selectors: ['*[rel="author"] *[itemprop="name"]'], + }, + + date_published: { + selectors: [['.byline time', 'datetime']], + }, + + dek: { + selectors: ['h2[itemprop="description"]'], + }, + + lead_image_url: { + selectors: [['meta[name="og:image"]', 'value']], + }, + + content: { + selectors: ['div[itemprop="articleBody"]'], + + // Is there anything in the content you selected that needs transformed + // before it's consumable content? E.g., unusual lazy loaded images + transforms: { + h2: $node => { + // Some pages have an element h2 that is significant, and that the parser will + // remove if not following a paragraph. Adding this empty paragraph fixes it, and + // the empty paragraph will be removed anyway. + $node.before('

'); + }, + }, + + // Is there anything that is in the result that shouldn't be? + // The clean selectors will remove anything that matches from + // the result. + clean: [ + // Remove enlarge links and separators inside image captions. + 'figcaption .enlarge-link', + 'figcaption .sep', + + // I could not transform the video into usable elements, so I + // removed them. + 'figure.video', + + // Image galleries that do not work. + '.gallery', + + 'aside', + '.sidebar', + ], + }, +}; diff --git a/src/extractors/custom/arstechnica.com/index.test.js b/src/extractors/custom/arstechnica.com/index.test.js new file mode 100644 index 00000000..547800c3 --- /dev/null +++ b/src/extractors/custom/arstechnica.com/index.test.js @@ -0,0 +1,159 @@ +import assert from 'assert'; +import URL from 'url'; +import cheerio from 'cheerio'; + +import Mercury from 'mercury'; +import getExtractor from 'extractors/get-extractor'; +import { excerptContent } from 'utils/text'; + +const fs = require('fs'); + +describe('ArstechnicaComExtractor', () => { + describe('initial test case', () => { + let result; + let url; + beforeAll(() => { + url = + 'https://arstechnica.com/gadgets/2016/08/the-connected-renter-how-to-make-your-apartment-smarter/'; + const html = fs.readFileSync( + './fixtures/arstechnica.com/1587927767738.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/arstechnica.com/index.js. + const { title } = await result; + + // Update these values with the expected values from + // the article. + assert.equal( + title, + `The connected renter: How to make your apartment smarter` + ); + }); + + it('returns the author', async () => { + // To pass this test, fill out the author selector + // in ./src/extractors/custom/arstechnica.com/index.js. + const { author } = await result; + + // Update these values with the expected values from + // the article. + assert.equal(author, `Valentina Palladino`); + }); + + it('returns the date_published', async () => { + // To pass this test, fill out the date_published selector + // in ./src/extractors/custom/arstechnica.com/index.js. + const { date_published } = await result; + + // Update these values with the expected values from + // the article. + assert.equal(date_published, `2016-08-10T11:15:53.000Z`); + }); + + it('returns the dek', async () => { + // To pass this test, fill out the dek selector + // in ./src/extractors/custom/arstechnica.com/index.js. + const { dek } = await result; + + // Update these values with the expected values from + // the article. + assert.equal( + dek, + 'Turning your rented space into a smart home can be tricky; we have some advice.' + ); + }); + + it('returns the lead_image_url', async () => { + // To pass this test, fill out the lead_image_url selector + // in ./src/extractors/custom/arstechnica.com/index.js. + const { lead_image_url } = await result; + + // Update these values with the expected values from + // the article. + assert.equal( + lead_image_url, + `https://cdn.arstechnica.net/wp-content/uploads/2016/07/smartapartment_hero5-640x215.jpg` + ); + }); + + // it('returns the pages_rendered', async () => { + // // To pass this test, fill out the pages_rendered selector + // // in ./src/extractors/custom/arstechnica.com/index.js. + // const { pages_rendered } = await result + // + // // Update these values with the expected values from + // // the article. + // assert.equal(pages_rendered, `3`) + // }); + + it('returns the content', async () => { + // To pass this test, fill out the content selector + // in ./src/extractors/custom/arstechnica.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, + "Name a home appliance or product, and there's probably a smart version of" + ); + }); + }); + + describe('Keep the first h2 on subsequent pages test', () => { + let result; + let url; + beforeAll(() => { + url = + 'https://arstechnica.com/science/2020/04/should-you-wear-a-face-mask-heres-all-the-data-we-have/2/'; + const html = fs.readFileSync( + './fixtures/arstechnica.com/1587927767738.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 content', async () => { + // To pass this test, fill out the content selector + // in ./src/extractors/custom/arstechnica.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 h2 = $('h2'); + assert.equal(h2.length, 1); + }); + }); +}); diff --git a/src/extractors/custom/index.js b/src/extractors/custom/index.js index 8813e52f..d3ea4e5e 100644 --- a/src/extractors/custom/index.js +++ b/src/extractors/custom/index.js @@ -139,3 +139,4 @@ export * from './pastebin.com'; export * from './www.abendblatt.de'; export * from './www.gruene.de'; export * from './www.engadget.com'; +export * from './arstechnica.com';