Add scraping of PRISM tags to html-metadata node library
We use the node.js html-metadata library to scrape metadata from webpages. This metadata is then used to generate a citation for the webpage using citoid. Editors can use this citation when they're writing or editing an article on Wikipedia as a reference.
PRISM Tags are a type of metadata in a webpage that gives information about how to cite the resource. Example of prism metadata tag from a nature.com article:
view-source:https://www.nature.com/articles/nature24679
<meta name="prism.publicationName" content="Nature"/>You should create a function called exports.parsePrism in https://github.com/wikimedia/html-metadata/blob/master/lib/index.js that scrapes all the prism tags, and creates a javascript object. This object should contain all of the tag names as keys (excluding the prism. prefix) and contains the content of the tag as the value. If there are multiple values for the same tag name, these should be in an Array. You should also register the method in https://github.com/wikimedia/html-metadata/blob/master/index.js
You should also create tests for your new function. You can put tests of a live website in https://github.com/wikimedia/html-metadata/blob/master/test/scraping.js. You can also create tests of a static website in https://github.com/wikimedia/html-metadata/blob/master/test/static.js.
Information about PRISM: http://www.idealliance.org/specifications/prism-metadata-initiative/ https://www.idealliance.org/prism-metadata