diff --git a/hrb/manifest.json b/hrb/manifest.json new file mode 100644 index 00000000..783cacfd --- /dev/null +++ b/hrb/manifest.json @@ -0,0 +1,13 @@ +{ + "longname": "HyRead ebook", + "name": "hrb", + "describe": "Recognizes the accesses to the platform HyRead ebook", + "contact": "Violita Kovchegov", + "pkb": false, + "docurl": "https://analyses.ezpaarse.org/platforms/6169500277b41e76a7188dfd", + "domains": [ + "ntust.ebook.hyread.com.tw" + ], + "version": "2024-08-09", + "status": "beta" +} \ No newline at end of file diff --git a/hrb/parser.js b/hrb/parser.js new file mode 100755 index 00000000..b0ccacc6 --- /dev/null +++ b/hrb/parser.js @@ -0,0 +1,33 @@ +#!/usr/bin/env node + +'use strict'; +const Parser = require('../.lib/parser.js'); + +/** + * Recognizes the accesses to the platform HyRead ebook + * @param {Object} parsedUrl an object representing the URL to analyze + * main attributes: pathname, query, hostname + * @param {Object} ec an object representing the EC whose URL is being analyzed + * @return {Object} the result + */ +module.exports = new Parser(function analyseEC(parsedUrl, ec) { + let result = {}; + let path = parsedUrl.pathname; + // uncomment this line if you need parameters + let param = parsedUrl.query || {}; + + // use console.error for debuging + // console.error(parsedUrl); + + //let match; + + if (/^\/bookDetail.jsp$/i.test(path)) { + // http://ntust.ebook.hyread.com.tw/bookDetail.jsp?id=177049 + // http://ntust.ebook.hyread.com.tw/bookDetail.jsp?id=203257 + result.rtype = 'RECORD'; + result.mime = 'HTML'; + result.unitid = param.id; + + } + return result; +}); diff --git a/hrb/test/hrb.2024-08-09.csv b/hrb/test/hrb.2024-08-09.csv new file mode 100644 index 00000000..0e3b7836 --- /dev/null +++ b/hrb/test/hrb.2024-08-09.csv @@ -0,0 +1,3 @@ +out-unitid;out-rtype;out-mime;in-url +177049;RECORD;HTML;http://ntust.ebook.hyread.com.tw/bookDetail.jsp?id=177049 +203257;RECORD;HTML;http://ntust.ebook.hyread.com.tw/bookDetail.jsp?id=203257 \ No newline at end of file