-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
55786a0
commit af39a22
Showing
3 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |