Skip to content

Commit 79f3330

Browse files
authored
Don't remove trailing slash (#91)
1 parent d016735 commit 79f3330

File tree

2 files changed

+26
-24
lines changed

2 files changed

+26
-24
lines changed

packages/metascraper-helpers/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ const urlTest = (url, {relative = true}) => relative
1717

1818
const isUrl = (url, opts = {}) => !isEmpty(url) && urlTest(url, opts)
1919

20-
const normalizeUrl = url => sanetizeUrl(url, {
20+
const normalizeUrl = (url, opts) => sanetizeUrl(url, {
2121
stripWWW: false,
22-
sortQueryParameters: false
22+
sortQueryParameters: false,
23+
removeTrailingSlash: false,
24+
...opts
2325
})
2426

2527
const getAbsoluteUrl = (baseUrl, relativePath = '') => resolveUrl(baseUrl, relativePath)

packages/metascraper/__snapshots__/index.js.snap-shot

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ exports['arstechnica 1'] = {
2121
"logo": "https://cdn.arstechnica.net/wp-content/themes/ars/assets/img/material-ars-db41652381.png",
2222
"publisher": "Ars Technica",
2323
"title": "More than a decade later, how do original YouTube stars feel about the site?",
24-
"url": "https://arstechnica.com/features/2017/06/youtube-changed-my-life-a-pair-of-original-videostars-ponder-a-life-lived-online"
24+
"url": "https://arstechnica.com/features/2017/06/youtube-changed-my-life-a-pair-of-original-videostars-ponder-a-life-lived-online/"
2525
}
2626

2727
exports['astier 1'] = {
@@ -60,7 +60,7 @@ exports['audiense 1'] = {
6060
"logo": "https://audiense.com/wp-content/uploads/2016/03/favicon.png",
6161
"publisher": "Audiense",
6262
"title": "Twin Peaks 2017: Using the data to create the next big TV sensation | Audiense",
63-
"url": "https://audiense.com/twin-peaks-2017-using-the-social-data-audience-consumer-insights-to-create-the-next-big-tv-sensation"
63+
"url": "https://audiense.com/twin-peaks-2017-using-the-social-data-audience-consumer-insights-to-create-the-next-big-tv-sensation/"
6464
}
6565

6666
exports['bbc 1'] = {
@@ -151,7 +151,7 @@ exports['cnet 1'] = {
151151
"logo": null,
152152
"publisher": "CNET",
153153
"title": "Pebble 2, Pebble Time 2, Pebble Core: Pebble’s fitness hat trick adds heart rate, GPS, Spotify, and 3G",
154-
"url": "http://www.cnet.com/news/pebble-2-pebble-time-2-pebble-core-announced-coming-this-year-and-2017"
154+
"url": "http://www.cnet.com/news/pebble-2-pebble-time-2-pebble-core-announced-coming-this-year-and-2017/"
155155
}
156156

157157
exports['computerworld 1'] = {
@@ -294,7 +294,7 @@ exports['forbes 1'] = {
294294
"logo": "http://i.forbesimg.com/media/assets/appicons/forbes-app-icon_144x144.png",
295295
"publisher": "Forbes",
296296
"title": "Facebook Veteran Grady Burnett Joins HackerRank As COO",
297-
"url": "http://www.forbes.com/sites/georgeanders/2015/09/30/facebook-veteran-grady-burnett-joins-hackerrank-as-coo"
297+
"url": "http://www.forbes.com/sites/georgeanders/2015/09/30/facebook-veteran-grady-burnett-joins-hackerrank-as-coo/"
298298
}
299299

300300
exports['fortune 1'] = {
@@ -307,7 +307,7 @@ exports['fortune 1'] = {
307307
"logo": "http://fortune.com/img/favicons/favicon-192.png",
308308
"publisher": "Fortune",
309309
"title": "Why your next job search may involve solving online puzzles",
310-
"url": "http://fortune.com/2015/10/05/hackerrank-recruiting-tool"
310+
"url": "http://fortune.com/2015/10/05/hackerrank-recruiting-tool/"
311311
}
312312

313313
exports['geek-time 1'] = {
@@ -320,7 +320,7 @@ exports['geek-time 1'] = {
320320
"logo": "http://www.geektime.com/wp-content/themes/geektimeV2/css/images/favicon.ico",
321321
"publisher": "Geektime",
322322
"title": "Fraud solutions Forter secures payment of $32M in Series C",
323-
"url": "http://www.geektime.com/2016/04/21/fraud-solutions-forter-secures-payment-of-32m-in-series-c"
323+
"url": "http://www.geektime.com/2016/04/21/fraud-solutions-forter-secures-payment-of-32m-in-series-c/"
324324
}
325325

326326
exports['github 1'] = {
@@ -385,7 +385,7 @@ exports['instagram 1'] = {
385385
"logo": "https://www.instagram.com/static/images/ico/favicon-192.png/b407fa101800.png",
386386
"publisher": "Instagram",
387387
"title": "Instagram post by Tesla • Jul 9, 2017 at 4:58am UTC",
388-
"url": "https://www.instagram.com/p/BWUDBntl3_Z"
388+
"url": "https://www.instagram.com/p/BWUDBntl3_Z/"
389389
}
390390

391391
exports['jewish-business-news 1'] = {
@@ -398,7 +398,7 @@ exports['jewish-business-news 1'] = {
398398
"logo": "http://2xkcvt35vyxycuy7x23e0em1a5g.wpengine.netdna-cdn.com/favicon-196x196.png",
399399
"publisher": "Jewish Business News",
400400
"title": "Israeli startup JFrog raises $50 million in C round",
401-
"url": "http://jewishbusinessnews.com/2016/01/20/israeli-startup-jfrog-raises-50-million-in-c-round"
401+
"url": "http://jewishbusinessnews.com/2016/01/20/israeli-startup-jfrog-raises-50-million-in-c-round/"
402402
}
403403

404404
exports['lean-data 1'] = {
@@ -463,7 +463,7 @@ exports['mac-rumors 1'] = {
463463
"logo": "http://cdn.macrumors.com/images-new/apple-touch-icon.png",
464464
"publisher": "MacRumors",
465465
"title": "Apple Working on Amazon Echo Competitor, Opening Siri Up to Developers",
466-
"url": "http://www.macrumors.com/2016/05/24/apple-siri-sdk-amazon-echo-competitor"
466+
"url": "http://www.macrumors.com/2016/05/24/apple-siri-sdk-amazon-echo-competitor/"
467467
}
468468

469469
exports['market-wired 1'] = {
@@ -502,7 +502,7 @@ exports['mashable 1'] = {
502502
"logo": "http://mashable.com/android-chrome-192x192.png?v=m2Pmw8zNwl",
503503
"publisher": "Mashable",
504504
"title": "The sales cycle on steroids: 3 ways analytics power up revenue",
505-
"url": "http://mashable.com/2015/05/13/analytics-power-up-revenue"
505+
"url": "http://mashable.com/2015/05/13/analytics-power-up-revenue/"
506506
}
507507

508508
exports['medium 1'] = {
@@ -632,7 +632,7 @@ exports['segment-academy 1'] = {
632632
"logo": null,
633633
"publisher": "Segment",
634634
"title": "When to Track on the Client vs. Server",
635-
"url": "https://www.segment.com/academy/collecting-data/when-to-track-on-the-client-vs-server"
635+
"url": "https://www.segment.com/academy/collecting-data/when-to-track-on-the-client-vs-server/"
636636
}
637637

638638
exports['silicon-angle 1'] = {
@@ -645,7 +645,7 @@ exports['silicon-angle 1'] = {
645645
"logo": "http://siliconangle.com/files/2015/04/favicon-SA.png",
646646
"publisher": "SiliconANGLE",
647647
"title": "CircleCI receives $18 million in Series B funding round with Scale Venture Partners",
648-
"url": "http://siliconangle.com/blog/2016/05/16/circleci-receives-18-million-in-series-b-funding-round-with-scale-venture-partners"
648+
"url": "http://siliconangle.com/blog/2016/05/16/circleci-receives-18-million-in-series-b-funding-round-with-scale-venture-partners/"
649649
}
650650

651651
exports['silicon-beat 1'] = {
@@ -658,7 +658,7 @@ exports['silicon-beat 1'] = {
658658
"logo": null,
659659
"publisher": "SiliconBeat",
660660
"title": "VC: Time to ‘come out as a woman’",
661-
"url": "http://www.siliconbeat.com/2016/04/19/time-come-woman"
661+
"url": "http://www.siliconbeat.com/2016/04/19/time-come-woman/"
662662
}
663663

664664
exports['silicon-tap 1'] = {
@@ -697,7 +697,7 @@ exports['smitten-kitchen 1'] = {
697697
"logo": "http://smittenkitchen.com/uploads/favicon.ico",
698698
"publisher": "smitten kitchen",
699699
"title": "cucumber yogurt raita salad",
700-
"url": "http://smittenkitchen.com/blog/2016/05/cucumber-yogurt-raita-salad"
700+
"url": "http://smittenkitchen.com/blog/2016/05/cucumber-yogurt-raita-salad/"
701701
}
702702

703703
exports['startup-grind 1'] = {
@@ -723,7 +723,7 @@ exports['techcrunch 1'] = {
723723
"logo": "https://s0.wp.com/wp-content/themes/vip/techcrunch-2013/assets/images/homescreen_TCIcon_ipad_2x.png",
724724
"publisher": "TechCrunch",
725725
"title": "HackerRank Makes Technical Recruiting More Transparent",
726-
"url": "http://social.techcrunch.com/2016/01/12/hackerrank-jobs-takes-the-mystery-out-of-technical-recruiting"
726+
"url": "http://social.techcrunch.com/2016/01/12/hackerrank-jobs-takes-the-mystery-out-of-technical-recruiting/"
727727
}
728728

729729
exports['the-boston-globe 1'] = {
@@ -762,7 +762,7 @@ exports['the-register 1'] = {
762762
"logo": "http://www.theregister.co.uk/Design/graphics/icons/vulture_black_60_trans.png",
763763
"publisher": null,
764764
"title": "EMC makes a LEAP forward with Virtustream and more",
765-
"url": "http://www.theregister.co.uk/2016/05/03/emc_world_virtustream_announcement"
765+
"url": "http://www.theregister.co.uk/2016/05/03/emc_world_virtustream_announcement/"
766766
}
767767

768768
exports['the-verge 1'] = {
@@ -814,7 +814,7 @@ exports['usa-today 1'] = {
814814
"logo": "http://www.gannett-cdn.com/sites/usatoday/images/favicon.png",
815815
"publisher": "USA TODAY",
816816
"title": "The TSA is trying not to ruin your summer vacation",
817-
"url": "http://www.usatoday.com/story/news/2016/05/24/evening-news-roundup-tuesday/84846520"
817+
"url": "http://www.usatoday.com/story/news/2016/05/24/evening-news-roundup-tuesday/84846520/"
818818
}
819819

820820
exports['venture-beat 1'] = {
@@ -827,7 +827,7 @@ exports['venture-beat 1'] = {
827827
"logo": "http://1u88jj3r4db2x4txp44yqfj1.wpengine.netdna-cdn.com/wp-content/themes/vbnews/img/favicon.ico",
828828
"publisher": "VentureBeat",
829829
"title": "Forter raises $32 million to automate retailers’ battle against online fraud",
830-
"url": "http://venturebeat.com/2016/04/21/forter-raises-32-million-to-automate-retailers-battle-against-online-fraud"
830+
"url": "http://venturebeat.com/2016/04/21/forter-raises-32-million-to-automate-retailers-battle-against-online-fraud/"
831831
}
832832

833833
exports['vimeo 1'] = {
@@ -853,7 +853,7 @@ exports['washington-post 1'] = {
853853
"logo": null,
854854
"publisher": "Washington Post",
855855
"title": "Twitter says goodbye to all ‘.@’",
856-
"url": "https://www.washingtonpost.com/news/the-intersect/wp/2016/05/24/twitter-says-goodbye-to-all"
856+
"url": "https://www.washingtonpost.com/news/the-intersect/wp/2016/05/24/twitter-says-goodbye-to-all/"
857857
}
858858

859859
exports['wired 1'] = {
@@ -866,7 +866,7 @@ exports['wired 1'] = {
866866
"logo": null,
867867
"publisher": "WIRED",
868868
"title": "Giant Antarctic Icebergs and Crushing Existential Dread",
869-
"url": "https://www.wired.com/story/giant-antarctic-icebergs-and-crushing-existential-dread"
869+
"url": "https://www.wired.com/story/giant-antarctic-icebergs-and-crushing-existential-dread/"
870870
}
871871

872872
exports['wsj 1'] = {
@@ -892,7 +892,7 @@ exports['xconomy 1'] = {
892892
"logo": "http://www.xconomy.com/wordpress/wp-content/themes/xconomy/images/favicon.ico",
893893
"publisher": "Xconomy",
894894
"title": "Cybersecurity Company Agari Raises $22M For E-Mail Shield | Xconomy",
895-
"url": "http://www.xconomy.com/san-francisco/2016/05/24/cybersecurity-company-agari-raises-22m-for-e-mail-shield"
895+
"url": "http://www.xconomy.com/san-francisco/2016/05/24/cybersecurity-company-agari-raises-22m-for-e-mail-shield/"
896896
}
897897

898898
exports['yahoo-news 1'] = {
@@ -918,7 +918,7 @@ exports['zdnet 1'] = {
918918
"logo": "http://zdnet1.cbsistatic.com/fly/bundles/zdnetcss/images/logos/logo-192x192.png",
919919
"publisher": "ZDNet",
920920
"title": "Email security startup Agari raises $22 million to help enterprises fight phishing attacks | ZDNet",
921-
"url": "http://www.zdnet.com/article/email-security-startup-agari-raises-22-million-to-help-enterprises-fight-phishing-attacks"
921+
"url": "http://www.zdnet.com/article/email-security-startup-agari-raises-22-million-to-help-enterprises-fight-phishing-attacks/"
922922
}
923923

924924
exports['soundcloud 1'] = {

0 commit comments

Comments
 (0)