From 66da5eb677d82c763554be812db396067ef67b26 Mon Sep 17 00:00:00 2001 From: fent <933490+fent@users.noreply.github.com> Date: Thu, 22 Feb 2018 00:51:19 -0500 Subject: [PATCH] fix(rss): Fix parsing RDF feeds closes #22 --- lib/xmlfeedparser.js | 19 +- test/assets/rdf.xml | 1014 ++++++++++++++++++++++++++++++++++++++++++ test/rdf-test.js | 72 +++ 3 files changed, 1098 insertions(+), 7 deletions(-) create mode 100644 test/assets/rdf.xml create mode 100644 test/rdf-test.js diff --git a/lib/xmlfeedparser.js b/lib/xmlfeedparser.js index 4e33c8c..aece99a 100644 --- a/lib/xmlfeedparser.js +++ b/lib/xmlfeedparser.js @@ -1,3 +1,5 @@ +'use strict'; + const sax = require('sax'); @@ -85,10 +87,9 @@ module.exports = (buffer) => { // First start listening for the root tag. var openf1 = function(node) { - var type; if (node.name === 'channel' || node.name === 'feed') { if (node.name === 'feed') { - type = 'atom'; + let type = 'atom'; obj.type = type; this.emit('type', type); } @@ -98,8 +99,8 @@ module.exports = (buffer) => { parser.on('opentag', onopentag); parser.on('closetag', onclosetag); - } else if (node.name === 'rss') { - type = 'rss ' + node.attributes.version; + } else if (node.name === 'rss' || node.name === 'rdf:rdf') { + let type = 'rss ' + (node.attributes.version || '1.0'); obj.type = type; this.emit('type', type); } else { @@ -150,9 +151,13 @@ module.exports = (buffer) => { obj[key] = cleanObj(obj[key]); if (!stack.length) { - key = key === 'entry' || key === 'items' ? 'item' : key; - parser.emit(key, data); - if (!buffer) { delete obj[key]; } + var skey = key === 'entry' || key === 'items' ? 'item' : key; + // Some feeds will contain a summary of items at the top. + // Ignore this. + if (key !== 'items' || Array.isArray(data)) { + parser.emit(skey, data); + if (!buffer) { delete obj[key]; } + } } } diff --git a/test/assets/rdf.xml b/test/assets/rdf.xml new file mode 100644 index 0000000..fded988 --- /dev/null +++ b/test/assets/rdf.xml @@ -0,0 +1,1014 @@ + + + + Pinboard (items tagged hardware) + https://pinboard.in/t:hardware/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fx2grok-tiny: an 11x11mm FX2 based Open Hardware logic analyzer for use with sigrok | The ever-expanding world of sigrok + 2018-02-22T03:14:29+00:00 + https://sigrok.org/blog/fx2grok-tiny-11x11mm-fx2-based-open-hardware-logic-analyzer-use-sigrok + zaklogic analysis open hardware electronics +http://pinboard.in/ +http://pinboard.in/u:zak/b:9a997ad2c64e/ + + + + + + + + + FrostyTech Synthetic Thermal Heatsink Test Results + 2018-02-22T01:00:20+00:00 + https://docs.google.com/spreadsheets/d/1xszfg-GNkOKoKZBIpo42cWLtPWg2hmbCcRD0wiCwTiA/htmlview# + killforlovereference Hardware +http://pinboard.in/u:killforlove/b:d96c4ce0fd89/ + + + + + + Why has CPU frequency ceased to grow? | Intel® Software + 2018-02-21T23:53:49+00:00 + https://software.intel.com/en-us/blogs/2014/02/19/why-has-cpu-frequency-ceased-to-grow + dahnielsonhardware cpu +http://pinboard.in/ +http://pinboard.in/u:dahnielson/b:6074c9f25ea1/ + + + + + + Macbook Repair in NYC | 347-552-2258 » + 2018-02-21T23:08:30+00:00 + https://www.rossmanngroup.com/ + andyhuey +mac apple hardware +http://pinboard.in/u:andyhuey/b:393dfbc29e5b/ + + + + + + + Choose Memory - PCPartPicker United Kingdom + 2018-02-21T23:01:52+00:00 + https://uk.pcpartpicker.com/products/memory/#Z=16384002&m=11&s=301600&t=11&sort=price&page=1 + dparodihardware compare memory +http://pinboard.in/ +http://pinboard.in/u:dparodi/b:280af805f44b/ + + + + + + + StarTech.com Thunderbolt 3 Dock - SD Card Reader - Dual-4K - 85W USB PD + 2018-02-21T22:09:34+00:00 + https://www.cdw.com/product/StarTech.com-Thunderbolt-3-Dock-SD-Card-Reader-Dual-4K-85W-USB-PD/4939123 + amyhardware stuff +http://pinboard.in/ +http://pinboard.in/u:amy/b:cb4be623e86c/ + + + + + + Spotify is ‘on its way’ to creating its first hardware according to job ad • Musically + 2018-02-21T20:40:08+00:00 + http://musically.com/2018/02/20/spotify-way-creating-first-hardware/ + charlesarthur

The role? “You will define and manage Distribution, Supply, Logistics, fulfillment and Customer Service for Hardware Products and work with partners to deliver the optimal Spotify experience to millions of users.” + +Based in Stockholm, this isn’t a job about managing integrations with third-party devices: among the job’s duties is to “manage the supply chain, demand and forecast & inventory”. + +Separate ads for a Senior Project Manager: Hardware Production and Project Manager: Hardware Production & Engineering are also indications that Spotify’s hardware plans are ramping up. + +Many people will leap to ‘smart speaker’ as the assumption about what the first Spotify-branded hardware product will be. Which begs the question: if so, where will its voice assistant – its equivalent of Alexa, Google Assistant and Siri – come from?

+ +We last heard about this in April 2017 and still there's no word of what this might be. Wearable? Smart speaker? Dumb speaker? Wait for production to start in the Far East, then I give it a couple of weeks to a leak.]]>
+Spotify hardware +http://pinboard.in/u:charlesarthur/b:523404664ee9/ + + + +
+ + W19L100-OFA1 | Industrial Displays | 01_0596 | WINMATE + 2018-02-21T20:03:34+00:00 + http://www.winmate.com.tw/IndustrialDisplay/LcdSpec.asp?Prod=01_0596&Typeid=B010103 + ash +monitors hardware +http://pinboard.in/ +http://pinboard.in/u:ash/b:c295e964b95a/ + + + + + + 8.8 Inch 1920x480 Tft Lcd Display Bar Type Tft Lcd Screen Stretched Lcd Panel - Buy 8.8 Inch 1920x480 Tft Lcd,8.8 Inch Bar Type Lcd Screen,8.8 Inch Stretched Lcd Panel Product on Alibaba.com + 2018-02-21T19:40:41+00:00 + https://www.alibaba.com/product-detail/8-8-inch-1920x480-TFT-LCD_60405442794.html?spm=a2700.7724857/A.main07.15.5f66ce4bk9jmFM + ash +monitors hardware +http://pinboard.in/ +http://pinboard.in/u:ash/b:c7a17447b11e/ + + + + + + TFX 3 LCD Military Grade Rugged RackMount Display Monitor + 2018-02-21T19:40:01+00:00 + http://www.chassis-plans.com/military-monitors-lcd-displays/tfx-rackmount-triple-lcd-display/ + ashha hardware rackmount monitors +http://pinboard.in/ +http://pinboard.in/u:ash/b:f0d1ce736f60/ + + + + + + + + Teensy USB Development Board + 2018-02-21T18:37:05+00:00 + https://www.pjrc.com/teensy/ + Brandonshire +electronics hardware arduino arcade diy colecovision intellivision atari atari5200 emulation raspberrypi +http://pinboard.in/ +http://pinboard.in/u:Brandonshire/b:3bb32bb8d655/ + + + + + + + + + + + + + + + How a 555 Timer IC Works | Lobsters + 2018-02-21T18:05:21+00:00 + https://lobste.rs/s/bsefhx + tjweir +video hardware +http://twitter.com/ +http://pinboard.in/u:tjweir/b:82e6b1651953/ + + + + + + Untitled (https://www.youtube.com/watch?v=i0SNb__dkYI) + 2018-02-21T18:05:21+00:00 + https://www.youtube.com/watch?v=i0SNb__dkYI + tjweir +video hardware +http://twitter.com/ +http://pinboard.in/u:tjweir/b:ede3ccb85164/ + + + + + + Printed Circuit Board Antennas| Commercial and Hobby Antennas + 2018-02-21T17:23:14+00:00 + http://www.wa5vjb.com/products.html + horshacktestwireless hardware network +http://pinboard.in/ +http://pinboard.in/u:horshacktest/b:3efea00bfbf3/ + + + + + + + MacBook Pro Retina: SSD aufrüsten (Anleitung) › Datenreise + 2018-02-21T13:40:11+00:00 + https://www.datenreise.de/macbook-pro-retina-ssd-aufruesten-anleitung/ + michaelhhengmacbook ssd hardware +http://pinboard.in/u:michaelhheng/b:0150ff9af9e5/ + + + + + + + MacBook Pro Retina aufrüsten: SSD tauschen und Speicher erweitern - mac&egg + 2018-02-21T13:39:59+00:00 + https://macandegg.de/upkeep/macbook-pro-retina-aufruesten-ssd-tauschen-und-speicher-erweitern/ + michaelhhengmacbook ssd hardware +http://pinboard.in/u:michaelhheng/b:3b9245b08617/ + + + + + + + MacBook Pro 15" Retina Display Ende 2013 SSD austauschen - iFixit + 2018-02-21T13:39:52+00:00 + https://de.ifixit.com/Anleitung/MacBook+Pro+15-Inch+Retina+Display+Ende+2013+SSD+austauschen/23431 + michaelhhengifixit macbook ssd hardware +http://pinboard.in/u:michaelhheng/b:29aadbcf68f6/ + + + + + + + + Google sold 3.9 million Pixel phones in 2017 - The Verge + 2018-02-21T11:44:17+00:00 + https://www.theverge.com/2018/2/13/17007104/google-pixel-total-sales-idc-statistics + dancall +mobile hardware stats google +http://pinboard.in/ +http://pinboard.in/u:dancall/b:6b172616f10d/ + + + + + + + + Why has CPU frequency ceased to grow? | Intel® Software + 2018-02-21T11:17:12+00:00 + https://software.intel.com/en-us/blogs/2014/02/19/why-has-cpu-frequency-ceased-to-grow + mkellercpu hardware +http://pinboard.in/ +http://pinboard.in/u:mkeller/b:10a078ef9377/ + + + + + + [Liquid Metal Showdown] Thermal Grizzly Conductonaut vs Cool Laboratory Liquid Ultra / Pro | NotebookReview + 2018-02-21T11:00:24+00:00 + http://forum.notebookreview.com/threads/liquid-metal-showdown-thermal-grizzly-conductonaut-vs-cool-laboratory-liquid-ultra-pro.791489/ + dakullhardware-tweaking hardware +http://pinboard.in/u:dakull/b:5955881582a7/ + + + + + + Shenzhen: The Silicon Valley of Hardware (Full Documentary) | Future Cities | WIRED - YouTube + 2018-02-21T09:49:02+00:00 + https://www.youtube.com/watch?v=SGJ5cZnoodY + whyleycstartup hardware shenzen documentary youtube +http://pinboard.in/ +http://pinboard.in/u:whyleyc/b:d19d80ad2b03/ + + + + + + + + + IOTLIST - Discover the Internet of Things + 2018-02-21T08:00:23+00:00 + http://iotlist.co/ + allenownhardware list iot +http://pinboard.in/ +http://pinboard.in/u:allenown/b:f544dc8fd2fb/ + + + + + + + Gesammelte Tipps / FAQ zu D3400 und D3417 No… | Forum - heise online + 2018-02-21T07:48:30+00:00 + https://www.heise.de/forum/c-t/Kommentare-zu-c-t-Artikeln/Heim-Server-im-Selbstbau/Gesammelte-Tipps-FAQ-zu-D3400-und-D3417-November-Edition/thread-5072832/#posting_29433680 + mkbauerhardware faq +http://pinboard.in/ +http://pinboard.in/u:mkbauer/b:2fc747c1d8ac/ + + + + + + About Apple video adapters and cables + 2018-02-21T06:11:55+00:00 + https://support.apple.com/en-us/HT201853 + sojourner +hardware audiovisual +http://pinboard.in/u:sojourner/b:091dd2745b2f/ + + + + + + USB Mini 58mm POS Thermal Dot Receipt Bill Printer Set Roll Paper Supermarket US | eBay + 2018-02-21T05:25:43+00:00 + https://www.ebay.com/itm/USB-Mini-58mm-POS-Thermal-Dot-Receipt-Bill-Printer-Set-Roll-Paper-Supermarket-US/301754687646?epid=2073468312&hash=item4641fb209e:g:V~EAAOSwceNaXjJ9 + jbmorley +hardware development +http://pinboard.in/u:jbmorley/b:775d9194127f/ + + + + + + Playing with the TrueRNG 2 hardware random number generator + 2018-02-21T05:14:42+00:00 + https://www.nu42.com/2015/08/playing-with-true-rng-hardware-random-number-generator.html + polinux perl randomness truerng hardware infosec security entropy +http://pinboard.in/ +http://pinboard.in/u:po/b:dc3285ca2404/ + + + + + + + + + + + + GnuPG notes: subkeys, yubikey, gpg1 vs gpg2 – There and back again + 2018-02-21T05:10:07+00:00 + https://www.preining.info/blog/2016/04/gnupg-subkeys-yubikey/ + potutorial howto linux security infosec gnupg gpg pgp yubikey hardware tokens key.management +http://pinboard.in/ +http://pinboard.in/u:po/b:57308043d8ea/ + + + + + + + + + + + + + + + + Spotify 'on its way' to creating first hardware product + 2018-02-21T04:33:32+00:00 + https://thenextweb.com/insider/2018/02/21/spotify-way-creating-first-hardware-product/ + jasonquinlan +Spotify 'on its way' to creating first hardware product +http://twitter.com/ +http://pinboard.in/u:jasonquinlan/b:66710ec133a9/ + + + + + + + + + + + + + Computer Parts, Laptops, Tablets, Monitors, Mobile Phones & More - PBTech.co.nz + 2018-02-21T01:51:31+00:00 + https://www.pbtech.co.nz/ + trippsNewZealand computer hardware +http://pinboard.in/u:tripps/b:434373979c0c/ + + + + + + + Hardware Upgrades + 2018-02-21T00:58:14+00:00 + https://feedbin.com/blog/2018/02/20/hardware-upgrades/ + angusfhardware webdev +http://pinboard.in/ +http://pinboard.in/u:angusf/b:8ba1b8dc1d19/ + + + + + + Net Express - SCSI cases + 2018-02-20T23:06:51+00:00 + http://www.netexpresslabs.com/cases/scsi.html + rubenerd +scsi enclosures hardware mmxtower +http://pinboard.in/ +http://pinboard.in/u:rubenerd/b:8c7ce71d545a/ + + + + + + + + 4 Bay 5.25" External SCSI Case - Cables Online + 2018-02-20T23:06:16+00:00 + http://www.cablesonline.com/4bay525exscs.html + rubenerd +scsi enclosures hardware mmxtower +http://pinboard.in/ +http://pinboard.in/u:rubenerd/b:33361951017f/ + + + + + + + + You're the first to know...about our EPIC announcement! + 2018-02-20T22:48:37+00:00 + http://blog.opto22.com/optoblog/youre-the-first-to-know-about-our-epic-announcement + oriolriusplc nodered hardware hw iot m2m node-red mqtt opc-ua opcua +http://pinboard.in/ +http://pinboard.in/u:oriolrius/b:f356af9878e3/ + + + + + + + + + + + + + + divMMC Future for the ZX Spectrum + 2018-02-20T20:44:52+00:00 + https://www.thefuturewas8bit.com/index.php/divmmcfuture + driscollretrocomputing hardware microcomputer computing hack hacking pc spectrum +http://pinboard.in/ +http://pinboard.in/u:driscoll/b:4ad9f36a3866/ + + + + + + + + + + + + Evoluent VerticalMouse Vertical Mouse + 2018-02-20T17:40:17+00:00 + https://evoluent.com/ + Chichibiohardware computers +http://pinboard.in/ +http://pinboard.in/u:Chichibio/b:8a8372ef4845/ + + + + + + [untitled] + 2018-02-20T17:21:19+00:00 + https://twitter.com/hashtag/plottertwitter + madamim +plotter hardware +http://pinboard.in/ +http://pinboard.in/u:madamim/b:0be99213a48f/ + + + + + + React Hardware + 2018-02-20T16:58:31+00:00 + http://iamdustan.com/2015/12/16/react-hardware/ + cyberchucktx +react hardware firmata embedded arduino +http://pinboard.in/ +http://pinboard.in/u:cyberchucktx/b:64c65023761b/ + + + + + + + + + Base functionality for working with a Raspberry Pi from Node.js + 2018-02-20T16:45:07+00:00 + https://github.com/nebrius/raspi + cyberchucktx +raspberrypi javascript hardware gpio nodejs +http://pinboard.in/ +http://pinboard.in/u:cyberchucktx/b:a0467bb48507/ + + + + + + + + + JavaScript with Hardware [Part Two]: Using Modern JavaScript - Hackster.io + 2018-02-20T16:38:29+00:00 + https://www.hackster.io/IainIsCreative/javascript-with-hardware-part-two-using-modern-javascript-c6f818 + cyberchucktx +javascript hardware hackster.io tutorial lint babel +http://pinboard.in/ +http://pinboard.in/u:cyberchucktx/b:1f100beff7c0/ + + + + + + + + + + How to watch live broadcast TV on your Apple TV without cable | iMore + 2018-02-20T16:25:23+00:00 + https://www.imore.com/how-watch-live-tv-your-apple-tv-without-cable + adamschoales +apple hardware how-to reference +http://pinboard.in/ +http://pinboard.in/u:adamschoales/b:f54a64a91940/ + + + + + + + + Samsung unveils world’s largest SSD with whopping 30TB of storage - The Verge + 2018-02-20T16:12:07+00:00 + https://www.theverge.com/circuitbreaker/2018/2/20/17031256/worlds-largest-ssd-drive-samsung-30-terabyte-pm1643 + iccohardware +http://pinboard.in/ +http://pinboard.in/u:icco/b:af6a2f8725be/ + + + + + How to identify defective DIMM from EDAC error on Linux - Fibrevillage + 2018-02-20T16:08:50+00:00 + http://fibrevillage.com/sysadmin/240-how-to-identify-defective-dimm-from-edac-error-on-linux-2 + nxghardware edac dimm +http://pinboard.in/ +http://pinboard.in/u:nxg/b:caac933de830/ + + + + + + + Johnny-Five projects page + 2018-02-20T16:03:58+00:00 + https://www.hackster.io/johnny-five/products/johnny-five + cyberchucktx +javscript hardware robotics arduino raspberrypi +http://pinboard.in/ +http://pinboard.in/u:cyberchucktx/b:8a5ebe2a5b88/ + + + + + + + + + Schneller Linux Fileserver / Datenserver im Eigenbau – Teil 1 Hardware – zazudesign – die Schwarzwald Werbeagentur sagt … + 2018-02-20T15:32:19+00:00 + http://die-schwarzwald-werbeagentur.zazudesign.de/hardware/schneller-linux-fileserver-datenserver-im-eigenbau-teil-1-hardware.html + aexelserver diy files hardware +http://pinboard.in/ +http://pinboard.in/u:aexel/b:710730b34fdc/ + + + + + + + + w3c/device-memory + 2018-02-20T15:20:11+00:00 + https://github.com/w3c/device-memory + johnloy +web-standards hardware javascript error-handling *read +http://pinboard.in/ +http://pinboard.in/u:johnloy/b:fb8f3ed30935/ + + + + + + + + + Before you blame market volatility on inflation, check out this ‘stunning’ chart - MarketWatch + 2018-02-20T13:58:35+00:00 + https://www.marketwatch.com/story/this-chart-shows-the-modern-equivalent-of-bread-and-circuses-to-sate-the-masses-2018-02-12?link=sfmw_tw + dancall +stats health economics mobile technology hardware +http://pinboard.in/ +http://pinboard.in/u:dancall/b:7a778712e4ea/ + + + + + + + + + + Harvard Design Magazine: Eyes That Do Not See: Tracking the Self in the Age of the Data Center + 2018-02-20T13:06:56+00:00 + http://www.harvarddesignmagazine.org/issues/38/eyes-that-do-not-see-tracking-the-self-in-the-age-of-the-data-center + janpeuker +urbanism networking hardware privacy +http://pinboard.in/ +http://pinboard.in/u:janpeuker/b:ddc325005aaf/ + + + + + + + + LIDAR-Lite v3 - SEN-14032 - SparkFun Electronics + 2018-02-20T12:42:03+00:00 + https://www.sparkfun.com/products/14032 + jstennerelectronics hardware laser +http://pinboard.in/ +http://pinboard.in/u:jstenner/b:67d91ac4c347/ + + + + + + + r/SuggestALaptop/ - Get laptop suggestions from geeks that know + 2018-02-20T11:55:27+00:00 + https://www.reddit.com/r/SuggestALaptop/ + kr4dhardware community advice +http://pinboard.in/ +http://pinboard.in/u:kr4d/b:9b03af1ab366/ + + + + + + + flirc.tv - Your TV - PC Remote Companion + 2018-02-20T11:21:31+00:00 + https://flirc.tv/ + bouvin +hardware raspberrypi remote +http://pinboard.in/ +http://pinboard.in/u:bouvin/b:89bd2639a05f/ + + + + + + + Twitter + 2018-02-20T07:34:14+00:00 + https://twitter.com/i/web/status/965852075400794112 + vielmetti +hardware +http://twitter.com/ +http://pinboard.in/u:vielmetti/b:6a0ec5021b4b/ + + + + + Gibson, Iconic Guitar Company, Said to Be Nearing Bankruptcy + 2018-02-20T07:33:59+00:00 + http://variety.com/2018/biz/news/gibson-iconic-guitar-company-said-to-be-nearing-bankruptcy-1202704143/ + 0xroy +Musique Hardware 🤔 +http://pinboard.in/u:0xroy/b:dd5cfa6a7847/ + + + + + + + Build a super fast deep learning machine for under $1,000 + 2018-02-20T06:49:13+00:00 + https://www.oreilly.com/learning/build-a-super-fast-deep-learning-machine-for-under-1000 + ttpro1995deeplearning PC hardware +http://pinboard.in/ +http://pinboard.in/u:ttpro1995/b:3658aa19e469/ + + + + + + + How iFixit Became the World's Best iPhone Teardown Team + 2018-02-20T00:36:36+00:00 + https://www.youtube.com/watch?v=tx-9LkVIdz0 + 0xroy +DIY Apple Hardware Vidéo +http://pinboard.in/u:0xroy/b:0ac4c44d2155/ + + + + + + + + End-of-Sale and End-of-Life Announcement for the Cisco 500 Series Stackable Managed Switches - Cisco + 2018-02-20T00:11:02+00:00 + https://www.cisco.com/c/en/us/products/collateral/switches/small-business-500-series-stackable-managed-switches/eos-eol-notice-c51-739827.html + natedocnetworking hardware +http://pinboard.in/u:natedoc/b:4c7d97e64551/ + + + + + + Amazon.com: SISUN ® 2.5"/3.5" IDE SATA HDD Docking Station +Card Reader Hub (Black): Computers & Accessories + 2018-02-19T21:48:09+00:00 + https://www.amazon.com/dp/B009F7TXMK/ref=psdc_160354011_t1_B01790511Q + gardencat +disk comp repair hardware +http://pinboard.in/ +http://pinboard.in/u:gardencat/b:dd0c409dc408/ + + + + + + + + Amazon.com: USB 2.0 External Enclosure for SATA or IDE 3.5-Inch Desktop Hard Drive HDD: Computers & Accessories + 2018-02-19T21:35:15+00:00 + https://www.amazon.com/External-Enclosure-3-5-Inch-Desktop-Drive/dp/B001UNPNQ2 + gardencat +disk hardware repair comp +http://pinboard.in/ +http://pinboard.in/u:gardencat/b:a3621cce414f/ + + + + + + + + Amazon.com: I/O Magic External 3.5" IDE/SATA USB 2.0 Aluminum Hard Drive Enclosure: Electronics + 2018-02-19T21:27:49+00:00 + https://www.amazon.com/Magic-External-Aluminum-Drive-Enclosure/dp/B003OAH696 + gardencat +comp hardware disk repair +http://pinboard.in/ +http://pinboard.in/u:gardencat/b:f35c145c887e/ + + + + + + + + DROP WIRELESS CHARGER - Made for iPhone and Qi Compatible Devices | NATIVE UNION + 2018-02-19T21:11:32+00:00 + https://www.nativeunion.com/drop-wireless-charger + benishiphone shopping hardware +http://pinboard.in/ +http://pinboard.in/u:benish/b:4026cd7bf37d/ + + + + + + + Pinterest - 404 + 2018-02-19T20:51:16+00:00 + https://www.pinterest.com/r/pin/985231153281067/4766733815989148850/c66ba024e690744bf1cf53f462d91378a4af8109cd86bce185ec6a21c1e14ee3 + muhhhardware projects +http://pinboard.in/u:muhh/b:94de988a1d62/ + + + + + + Repairing the card reader for a 1960s mainframe: cams, relays and a clutch + 2018-02-19T17:12:22+00:00 + http://www.righto.com/2018/02/repairing-card-reader-for-1960s.html?m=1 + drewishhardware electronics computers 1960s +http://pinboard.in/u:drewish/b:1e2fc7f42d7d/ + + + + + + + + Data Streaming Blog | Initial State + 2018-02-19T16:54:54+00:00 + http://blog.initialstate.com/ + clarsenblogs hardware iot +http://pinboard.in/ +http://pinboard.in/u:clarsen/b:2a949d9f9c54/ + + + + + + + 2010-2013 5,1 12-Core Mac Pro | iBuildMacs + 2018-02-19T15:52:15+00:00 + https://ibuildmacs.com/products/macpro-2010-2011-12-core/ + emorymac shopping hardware apple macpro +http://pinboard.in/ +http://pinboard.in/u:emory/b:7f160761cd25/ + + + + + + + + + Homemade GPS Receiver + 2018-02-19T10:12:44+00:00 + http://www.aholme.co.uk/GPS/Main.htm + apburgessfpga hardware gps +http://pinboard.in/ +http://pinboard.in/u:apburgess/b:0bbf29fc2733/ + + + + + + + Welcome to ESP8266 Arduino Core’s documentation! — ESP8266 Arduino Core 2.4.0 documentation + 2018-02-19T08:48:51+00:00 + https://arduino-esp8266.readthedocs.io/en/latest/ + andymplatformio esp hardware +http://pinboard.in/u:andym/b:f0548682b093/ + + + + + + + Время отклика компьютеров: 1977−2017 / Хабрахабр + 2018-02-19T08:09:32+00:00 + https://m.habrahabr.ru/post/345584/ + liruokohardware history computers personality +http://pinboard.in/u:liruoko/b:3c7edc3a4542/ + + + + + + + + randaller/cnn-rtlsdr: Deep learning signal classification using rtl-sdr dongle + 2018-02-19T04:12:50+00:00 + https://github.com/randaller/cnn-rtlsdr + teelerhardware programming learning sdr +http://pinboard.in/ +http://pinboard.in/u:teeler/b:71e28c9c8ac7/ + + + + + + + + MeArm – Mime Industries + 2018-02-18T22:19:35+00:00 + https://shop.mime.co.uk/collections/mearm + teelerhardware arm +http://pinboard.in/ +http://pinboard.in/u:teeler/b:8c54410e4d1f/ + + + + + + Computer latency: 1977-2017 + 2018-02-18T20:37:01+00:00 + https://danluu.com/input-lag/ + dentarghistory hardware latency performance computer wisdom +http://pinboard.in/ +http://pinboard.in/u:dentarg/b:c822921db47d/ + + + + + + + + + + Google Code Archive - Long-term storage for Google Code Project Hosting. + 2018-02-18T20:12:06+00:00 + https://code.google.com/archive/p/rigkontrol3-linux-midicontroller/ + klokie +audio midi hardware Linux +http://pinboard.in/ +http://pinboard.in/u:klokie/b:5c89936c1109/ + + + + + + +
\ No newline at end of file diff --git a/test/rdf-test.js b/test/rdf-test.js new file mode 100644 index 0000000..b38abfc --- /dev/null +++ b/test/rdf-test.js @@ -0,0 +1,72 @@ +const FeedMe = require('..'); +const fs = require('fs'); +const path = require('path'); +const assert = require('assert'); + + +const file1 = path.join(__dirname, 'assets', 'rdf.xml'); +const feed1 = { + type: 'rss 1.0', + title: 'Pinboard (items tagged hardware)', + link: 'https://pinboard.in/t:hardware/', + description: '', +}; + + +describe('Parse an RSS file with RDF schema', () => { + var parser = new FeedMe(); + var events = 0; + var item = 0; + + it('Matches JSON object', (done) => { + parser.on('type', (data) => { + assert.deepEqual(data, feed1.type); + events++; + }); + + parser.on('title', (data) => { + assert.equal(data, feed1.title); + events++; + }); + + parser.on('link', (data) => { + assert.equal(data, feed1.link); + events++; + }); + + parser.on('description', (data) => { + assert.equal(data, feed1.description); + events++; + }); + + parser.on('item', () => { + item++; + events++; + }); + + fs.createReadStream(file1).pipe(parser); + parser.on('end', () => { + assert.equal(events, 74); + assert.equal(item, 70); + assert.deepEqual(parser.done(), undefined); + done(); + }); + }); + + describe('with buffer on', () => { + var parser = new FeedMe(true); + + it('Returns matching Javascript object', (done) => { + fs.createReadStream(file1).pipe(parser); + parser.on('end', () => { + var doc = parser.done(); + assert.equal(doc.type, feed1.type); + assert.equal(doc.title, feed1.title); + assert.equal(doc.link, feed1.link); + assert.equal(doc.description, feed1.description); + assert.equal(doc.items.length, 70); + done(); + }); + }); + }); +});