feat: custom parser for phoronix.com. (#431)

pull/387/head^2
Ben Ubois 5 years ago committed by Adam Pash
parent 571a913745
commit 0942c37876

@ -0,0 +1,301 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Steam&apos;s Linux Marketshare Ticks Up Ever So Slightly For May - Phoronix</title>
<meta http-equiv="Content-Type" value="text/html; charset=UTF-8">
<link rel="stylesheet" href="https://www.phoronix.com/phxcms-css/phoronix-10.css?2019">
<meta name="viewport" value="width=device-width, initial-scale=1.0">
<link href="https://www.phoronix.com/phxcms7-css/shadowbox.css" rel="stylesheet" type="text/css">
<meta name="keywords" value="Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux Hardware, Linux benchmarking, Desktop Linux, GNU/Linux benchmarks, Open Source AMD, Linux How To, X.Org drivers, Ubuntu hardware, Phoronix Test Suite">
<meta name="Description" value="Phoronix is the leading technology website for Linux hardware reviews, open-source news, Linux benchmarks, open-source benchmarks, and computer hardware tests.">
<link rel="alternate" type="application/rss+xml" title="Phoronix" href="https://www.phoronix.com/rss.php">
<link rel="shortcut icon" href="https://www.phoronix.com/favicon.ico">
<link rel="apple-touch-icon" sizes="57x57" href="https://www.phoronix.com/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="https://www.phoronix.com/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="https://www.phoronix.com/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="https://www.phoronix.com/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="https://www.phoronix.com/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="https://www.phoronix.com/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="https://www.phoronix.com/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="https://www.phoronix.com/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="https://www.phoronix.com/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="https://www.phoronix.com/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="https://www.phoronix.com/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="https://www.phoronix.com/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="https://www.phoronix.com/favicon-16x16.png" sizes="16x16">
<meta name="msapplication-TileImage" value="/mstile-144x144.png">
</head>
<body style="overflow: initial !important;">
<div id="headerwrap">
<div class="wcontainer defpadding">
<a href="https://www.phoronix.com/scan.php?page=home"><img id="logo" alt="Phoronix" src="https://www.phoronix.com/phxcms7-css/phoronix.png" style="height: 40px; margin-top: 5px;margin-left: 5px;"></a>
<div id="headerright">
<div id="social">
<a href="https://www.phoronix.com/rss.php" class="icon-rss"></a>
<a href="https://twitter.com/Phoronix" class="icon-twitter"></a>
<a href="https://www.facebook.com/Phoronix" class="icon-facebook"></a>
</div>
</div>
</div>
</div>
<div id="litemenu">
<ul>
<li><a href="https://www.phoronix.com/scan.php?page=phoronix_articles">Articles &amp; Reviews</a></li>
<li><a href="https://www.phoronix.com/scan.php?page=phoronix_news">News Archive</a></li>
<li><a href="https://www.phoronix.com/forums/">Forums</a></li>
<li><a href="https://www.phoronix.com/scan.php?page=phoronix_premium">Premium</a></li> <li class="categ icon-angle-circled-down"><span> Categories</span></li>
<li><a href="https://www.phoronix.com/scan.php?page=category&amp;item=Computers">Computers</a></li>
<li><a href="https://www.phoronix.com/scan.php?page=category&amp;item=Display+Drivers">Display Drivers</a></li>
<li><a href="https://www.phoronix.com/scan.php?page=category&amp;item=Graphics+Cards">GPUs / Graphics Cards</a></li>
<li><a href="https://www.phoronix.com/scan.php?page=category&amp;item=Linux+Gaming">Linux Gaming</a></li>
<li><a href="https://www.phoronix.com/scan.php?page=category&amp;item=Memory">Memory</a></li>
<li><a href="https://www.phoronix.com/scan.php?page=category&amp;item=Motherboards">Motherboards</a></li>
<li><a href="https://www.phoronix.com/scan.php?page=category&amp;item=Processors">CPUs / Processors</a></li>
<li><a href="https://www.phoronix.com/scan.php?page=category&amp;item=Software">Software</a></li>
<li><a href="https://www.phoronix.com/scan.php?page=category&amp;item=Storage">Storage</a></li>
<li><a href="https://www.phoronix.com/scan.php?page=category&amp;item=Operating+Systems">Operating Systems</a></li>
<li><a href="https://www.phoronix.com/scan.php?page=category&amp;item=Peripherals">Peripherals</a></li>
<li id="closelid">Close</li>
</ul>
</div>
<div id="menuwrap">
<div class="wcontainer">
<ul id="linklist">
<li id="menubutton"><span class="icon-menu"></span>
</li>
<li class="menulink">
<a class="linknode" href="https://www.phoronix.com/scan.php?page=phoronix_articles">Articles &amp; Reviews</a>
</li>
<li class="menulink">
<a class="linknode" href="https://www.phoronix.com/scan.php?page=phoronix_news">News Archive</a>
</li>
<li class="menulink">
<a class="linknode" href="https://www.phoronix.com/forums/">Forums</a>
</li>
<li class="menulink">
<a class="linknode" href="https://www.phoronix.com/scan.php?page=phoronix_premium">Premium</a>
</li> <li id="categories-link" class="menulink">
<span class="menunolink icon-angle-circled-down"> Categories</span>
<div id="categories-list">
<div id="categories-content">
<a href="https://www.phoronix.com/scan.php?page=category&amp;item=Computers">Computers</a>
<a href="https://www.phoronix.com/scan.php?page=category&amp;item=Graphics+Cards">GPUs / Graphics Cards</a>
<a href="https://www.phoronix.com/scan.php?page=category&amp;item=Linux+Gaming">Linux Gaming</a>
<a href="https://www.phoronix.com/scan.php?page=category&amp;item=Memory">Memory</a>
<a href="https://www.phoronix.com/scan.php?page=category&amp;item=Motherboards">Motherboards</a>
<a href="https://www.phoronix.com/scan.php?page=category&amp;item=Processors">CPUs / Processors</a>
<a href="https://www.phoronix.com/scan.php?page=category&amp;item=Software">Software</a>
<a href="https://www.phoronix.com/scan.php?page=category&amp;item=Storage">Storage</a>
<a href="https://www.phoronix.com/scan.php?page=category&amp;item=Operating+Systems">Operating Systems</a>
<a href="https://www.phoronix.com/scan.php?page=category&amp;item=Peripherals">Peripherals</a>
</div>
</div>
</li>
<li id="searchbox">
<div id="search">
</div>
</li>
</ul>
</div>
</div>
<div id="content-bg">
<div id="content">
<div id="main-wrap">
<div id="main">
<div style="text-align: center; overflow: hidden; margin-bottom: 30px;">
</div>
<article class="full">
<strong id="fb14b" style="display: none; border: 1px solid #efefef; font-size: 11.5px; margin: 9px;"><strong style="font-weight: 800;">We Rely On Your Support:</strong> This site is primarily supported by advertisements. <span style="font-weight: 600;">Ads are what have allowed this site to be maintained for the past 15 years.</span> We do our best to ensure only clean, relevant ads are shown, when any nasty ads are detected, we work to remove them ASAP. If you would like to view the site without ads while still supporting our work, <span style="font-weight: 600;">please consider <a href="http://www.phoronix.com/scan.php?page=phoronix_premium">our ad-free Phoronix Premium</a></span>. You can also consider <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=3778540">a tip via PayPal</a>.</strong>
<header>Steam&apos;s Linux Marketshare Ticks Up Ever So Slightly For May</header>
<div class="author">Written by <a href="https://www.phoronix.com/scan.php?page=michaellarabel">Michael Larabel</a> in <a href="https://www.phoronix.com/scan.php?page=news_topic&amp;q=Valve">Valve</a> on 1 June 2019 at 08:34 PM EDT. <a href="https://www.phoronix.com/forums/node/1103455">Add A Comment</a></div>
<div class="content">
<div style="float: left; padding: 0 10px 10px;"><img alt="VALVE -- " src="https://www.phoronix.com/assets/categories/valve.jpg" width="100" height="100"></div>
With the start of a new month, Valve has published their software/hardware survey numbers for the month prior. For May 2019, the Steam Linux usage did tick-up slightly on a percentage basis. <br> <br>For last month, the percentage of Steam users running Linux (according to the controversial Steam Survey) rose to 0.84%, or a 0.02% increase over April. The number is largely in line with expectations of around 0.8% that it&apos;s been in that area recently and an increase over last year. <br> <br>On a percentage basis, the Linux gaming marketshare has tended to grow bit-by-bit since Valve introduced Steam Play last year for allowing many prominent Windows games to run on Linux thanks to their Wine-based Proton and DXVK for translating Direct3D to Vulkan. But there hasn&apos;t been any Linux exclusives, the return of Steam Machines, or any landmark reasons to cause a sudden shift of Windows gamers to switch over to Linux. As a result, it&apos;s just been either flat or tiny increases each month. <br> <br>Windows comes in at 95.9% for May&apos;s usage on Steam while macOS is at 3.26%. <br> <br>The monthly Steam survey data can be viewed at <a href="https://store.steampowered.com/hwsurvey/Steam-Hardware-Software-Survey-Welcome-to-Steam?platform=linux">SteamPowered.com</a>.</div>
<div style="text-align: center; overflow: hidden; margin-bottom: 30px;">
</div>
<div class="foot">
<div class="pagination">
</div>
<div class="comments-label">
<a href="https://www.phoronix.com/forums/node/1103455">Add A Comment</a> </div>
</div>
</article>
<div id="sharebar">
<div style="margin: 0 10px 10px; overflow: hidden;">
<div style="float: left; overflow: hidden;"><a href="https://twitter.com/share" class="twitter-share-button" data-text="Steam&apos;s Linux Marketshare Ticks Up Ever So Slightly For May" data-url="http://www.phoronix.com/scan.php?page=news_item&amp;px=Steam-May-2019-Numbers" data-via="phoronix" data-related="michaellarabel">Tweet</a>
</div>
<div style="float: left; overflow: hidden;"><iframe src="https://www.facebook.com/plugins/like.php?href=http://www.phoronix.com/scan.php%3Fpage%3Dnews_item%26amp%3Bpx%3DSteam-May-2019-Numbers&amp;width=200&amp;height=46&amp;colorscheme=light&amp;layout=button_count&amp;action=like&amp;show_faces=false&amp;send=true" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:200px; height:46px;" allowtransparency="true"></iframe></div>
</div></div>
<div class="after-article">
<div style="text-align: center; overflow: hidden; margin: 5px;">
<ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-0253814508491313" data-ad-slot="2439829920" data-ad-format="auto"></ins>
</div>
<div id="about-author">
<header>About The Author</header>
<img class="pic" src="https://www.phoronix.com/assets/categories/michaellarabel.jpg" alt="Author picture">
<div class="text"><p>Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 10,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via <a href="http://twitter.com/MichaelLarabel">Twitter</a> or contacted via <a href="http://www.michaellarabel.com/">MichaelLarabel.com</a>.</p></div>
</div>
<div class="article-box">
<header>Related Valve News</header>
<div class="node"><a href="https://www.phoronix.com/scan.php?page=news_item&amp;px=Valve-Proton-4.2-5">Valve&apos;s Proton Pulls In Latest DXVK, Steam Networking Updates, Controller Layout Fixes</a></div><div class="node"><a href="https://www.phoronix.com/scan.php?page=news_item&amp;px=Valve-Steam-Beta-15-May-2019">Valve Pushes Out Big Steam Beta Update, Linux Changes &amp; Steam Remote Play</a></div><div class="node"><a href="https://www.phoronix.com/scan.php?page=news_item&amp;px=Proton-4.2-4-Released">Proton 4.2-4 Released With Fix For RAGE 2, Updated DXVK</a></div><div class="node"><a href="https://www.phoronix.com/scan.php?page=news_item&amp;px=Valve-Index-Non-Desktop-Quirk">Linux DRM Adds Quirk For Dealing With Valve&apos;s Index VR Headset</a></div><div class="node"><a href="https://www.phoronix.com/scan.php?page=news_item&amp;px=Steam-Survey-April-2019">Steam Survey Data For April 2019 Shows Only Minor Change In Linux Use</a></div><div class="node"><a href="https://www.phoronix.com/scan.php?page=news_item&amp;px=Valve-Index-VR-Specs">Valve Reveals Specifications For Their Index VR Headset, Controllers &amp; Base Stations</a></div>
</div>
<div class="article-box">
<header>Popular News This Week</header>
<div class="node"><a href="https://www.phoronix.com/scan.php?page=news_item&amp;px=Google-Graphics-Rob-Clark">Google Hired Another Linux Graphics Veteran To Work On Open-Source GPU Drivers</a></div><div class="node"><a href="https://www.phoronix.com/scan.php?page=news_item&amp;px=Linux-5.1-FSTRIM-Bug">Linux 5.1 Hit By A Data Loss Bug Due To Overly Aggressive FSTRIM</a></div><div class="node"><a href="https://www.phoronix.com/scan.php?page=news_item&amp;px=Linux-5.1.5-Released">Linux 5.1.5 Kernel Fixes The Latest Data Corruption Bug</a></div><div class="node"><a href="https://www.phoronix.com/scan.php?page=news_item&amp;px=Linux-5.2-rc2-Released">Linux 5.2-rc2 Kernel Released As The &quot;Golden Lions&quot;</a></div><div class="node"><a href="https://www.phoronix.com/scan.php?page=news_item&amp;px=PCIe-5.0-Announced">PCI Express 5.0 Announced With 32GT/s Transfer Rates</a></div><div class="node"><a href="https://www.phoronix.com/scan.php?page=news_item&amp;px=Firefox-68-BigInt-Support">Firefox 68 Integrates BigInt Support</a></div>
</div> </div>
</div>
</div>
<div id="sidebar-wrap">
<div id="sidebar">
<aside>
<div style="text-align: center;">
</div>
</aside>
<aside class="widget">
<header>Latest Linux News</header><div class="popular-list">
<a href="https://www.phoronix.com/scan.php?page=news_item&amp;px=Steam-May-2019-Numbers">Steam&apos;s Linux Marketshare Ticks Up Ever So Slightly For May</a>
</div>
<div class="popular-list">
<a href="https://www.phoronix.com/scan.php?page=news_item&amp;px=Clear-Linux-Blocking-Dmesg">Clear Linux Moving Ahead With Blocking dmesg Access For Non-Root Users</a>
</div>
<div class="popular-list">
<a href="https://www.phoronix.com/scan.php?page=news_item&amp;px=Phoronix-15-Next-Week"><span style="font-weight: 600;">Phoronix Turns 15 Years Old Next Week So Here&apos;s Something Special</span></a>
</div>
<div class="popular-list">
<a href="https://www.phoronix.com/scan.php?page=news_item&amp;px=SolidRun-ClearFog-ARM-ITX">The ClearFog ARM ITX Workstation Performance Is Looking Very Good</a>
</div>
<div class="popular-list">
<a href="https://www.phoronix.com/scan.php?page=news_item&amp;px=nCine-Game-Engine">nCine Is An Interesting Open-Source 2D Game Engine</a>
</div>
<div class="popular-list">
<a href="https://www.phoronix.com/scan.php?page=news_item&amp;px=Golang-Cheaper-Context-Switches">Golang Gets Cheaper Context Switching</a>
</div>
<div class="popular-list">
<a href="https://www.phoronix.com/scan.php?page=news_item&amp;px=GNOME-Mutter-Sysprof-Lands">GNOME Shell &amp; Mutter Can Now Be Extensively Profiled For Missed Frames, Other Metrics</a>
</div>
<div class="popular-list">
<a href="https://www.phoronix.com/scan.php?page=news_item&amp;px=May-2019-Highlights">Zombieload, RHEL 8.0, Linux 5.2 &amp; GCC Happenings Dominated May</a>
</div>
<div class="popular-list">
<a href="https://www.phoronix.com/scan.php?page=news_item&amp;px=System76-May-Firmware-Progress">System76 Is Making Progress On Open-Source Firmware For Their Laptops</a>
</div>
<div class="popular-list">
<a href="https://www.phoronix.com/scan.php?page=news_item&amp;px=WireGuard-0.0.20190531">WireGuard Sees New Snapshot With Windows, Linux &amp; BSD Updates</a>
</div>
</aside>
<aside>
<div style="text-align: center;">
<div id="div-pg-ad-1506416552-1">
</div>
</div>
</aside>
<aside class="widget">
<header>Latest Featured Articles</header><div class="popular-list">
<a href="https://www.phoronix.com/vr.php?view=27932">DragonFlyBSD&apos;s Kernel Optimizations Are Paying Off - 3 BSDs &amp; 5 Linux OS Benchmarks On Threadripper</a>
</div>
<div class="popular-list">
<a href="https://www.phoronix.com/vr.php?view=27926">AMDVLK Still Has Some Performance Advantages Over Mesa&apos;s Radeon RADV Vulkan Driver, But It&apos;s A Good Fight</a>
</div>
<div class="popular-list">
<a href="https://www.phoronix.com/vr.php?view=27919">OpenSUSE Leap 15.1 Is Performing Very Well On AMD EPYC</a>
</div>
<div class="popular-list">
<a href="https://www.phoronix.com/vr.php?view=27916">Raptor&apos;s Blackbird Arrives As The Most Open-Source Yet Fast Desktop System</a>
</div>
<div class="popular-list">
<a href="https://www.phoronix.com/vr.php?view=27915">Mesa 19.1&apos;s New Features From The Intel Gallium3D Driver To New Drivers &amp; Vulkan Optimizations</a>
</div>
</aside>
<aside>
<div style="text-align: center;">
</div>
</aside>
<aside class="widget">
<header>Support Phoronix</header>
<p>The mission at Phoronix since 2004 has centered around enriching the Linux hardware experience. In addition to supporting our site through advertisements, you can help by <a href="https://www.phoronix.com/scan.php?page=phoronix_premium">subscribing to Phoronix Premium</a>. You can also use our <a href="http://www.tkqlhce.com/click-3677526-10515887-1435708588000">NewEgg.com</a> shopping links when making online purchases or contribute to Phoronix through a <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=3778540">PayPal tip</a>.</p>
</aside>
</div>
</div>
</div>
</div>
<div id="footer">
<div id="footer-content">
<p align="center"></p>
<div id="footer-left">
<div id="footer-left-content">
<div class="extra-info">
<header>Phoronix Media</header>
<hr>
<ul>
<li><a href="http://www.phoronix-test-suite.com/">Phoronix Test Suite</a></li>
<li><a href="http://openbenchmarking.org/">OpenBenchmarking.org</a></li>
<li><a href="http://www.phoromatic.com/">Phoromatic</a></li>
<li><a href="http://www.linuxbenchmarking.com/">LinuxBenchmarking.com</a></li>
</ul>
</div>
<div class="extra-info">
<header>Phoronix Premium</header>
<hr>
<a href="https://www.phoronix.com/scan.php?page=phoronix_premium"><ul>
<li>Support Phoronix</li>
<li>While Having Ad-Free Browsing,</li>
<li>Single-Page Article Viewing</li>
</ul></a>
</div>
<div class="extra-info">
<header>Share</header>
<hr>
<ul>
<li><a href="https://facebook.com/Phoronix">Facebook</a></li>
<li><a href="https://twitter.com/Phoronix">Twitter</a></li>
</ul>
</div>
</div>
</div>
<div id="footer-right">
<div class="extra-info">
<ul>
<li><p><a href="https://www.phoronix.com/scan.php?page=legal">Legal Disclaimer, Privacy Policy</a> | <a href="http://www.phoronix-media.com/?k=contact">Contact</a></p></li>
<li><p>Copyright &#xA9; 2004 - 2019 by <a href="http://www.phoronix-media.com/">Phoronix Media</a>.</p></li>
<li><p>All trademarks used are properties of their respective owners. All rights reserved.</p></li>
</ul>
</div>
</div>
</div>
</div>
</body>
</html>

@ -128,4 +128,5 @@ export * from './wired.jp';
export * from './japan.zdnet.com';
export * from './www.rbbtoday.com';
export * from './www.lemonde.fr';
export * from './www.phoronix.com';
export * from './pitchfork.com';

@ -0,0 +1,35 @@
export const WwwPhoronixComExtractor = {
domain: 'www.phoronix.com',
title: {
selectors: ['article header'],
},
author: {
selectors: ['.author a:first-child'],
},
date_published: {
selectors: ['.author'],
// 1 June 2019 at 08:34 PM EDT
format: 'D MMMM YYYY at hh:mm',
timezone: 'America/New_York',
},
dek: null,
lead_image_url: null,
content: {
selectors: ['.content'],
// Is there anything in the content you selected that needs transformed
// before it's consumable content? E.g., unusual lazy loaded images
transforms: {},
// Is there anything that is in the result that shouldn't be?
// The clean selectors will remove anything that matches from
// the result
clean: [],
},
};

@ -0,0 +1,109 @@
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('WwwPhoronixComExtractor', () => {
describe('initial test case', () => {
let result;
let url;
beforeAll(() => {
url =
'https://www.phoronix.com/scan.php?page=news_item&px=Steam-May-2019-Numbers';
const html = fs.readFileSync(
'./fixtures/www.phoronix.com/1559454992878.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.phoronix.com/index.js.
const { title } = await result;
// Update these values with the expected values from
// the article.
assert.equal(
title,
`Steam's Linux Marketshare Ticks Up Ever So Slightly For May`
);
});
it('returns the author', async () => {
// To pass this test, fill out the author selector
// in ./src/extractors/custom/www.phoronix.com/index.js.
const { author } = await result;
// Update these values with the expected values from
// the article.
assert.equal(author, 'Michael Larabel');
});
it('returns the date_published', async () => {
// To pass this test, fill out the date_published selector
// in ./src/extractors/custom/www.phoronix.com/index.js.
const { date_published } = await result;
// Update these values with the expected values from
// the article.
assert.equal(date_published, '2019-06-01T12:34:00.000Z');
});
it('returns the dek', async () => {
// To pass this test, fill out the dek selector
// in ./src/extractors/custom/www.phoronix.com/index.js.
const { dek } = await result;
// Update these values with the expected values from
// the article.
assert.equal(dek, null);
});
it('returns the lead_image_url', async () => {
// To pass this test, fill out the lead_image_url selector
// in ./src/extractors/custom/www.phoronix.com/index.js.
const { lead_image_url } = await result;
// Update these values with the expected values from
// the article.
assert.equal(lead_image_url, null);
});
it('returns the content', async () => {
// To pass this test, fill out the content selector
// in ./src/extractors/custom/www.phoronix.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,
'With the start of a new month, Valve has published their software/hardware survey'
);
});
});
});
Loading…
Cancel
Save