-
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.
Merge pull request #874 from ezpaarse-project:feature/ebsco25
feat(ebsco25): added support for new version of ebscohost
- Loading branch information
Showing
3 changed files
with
86 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,14 @@ | ||
{ | ||
"longname": "Ebsco Host 2025", | ||
"name": "ebsco25", | ||
"describe": "Recognizes the accesses to the platform Ebsco Host 2025", | ||
"contact": "Frederic Truong inist", | ||
"pkb": false, | ||
"docurl": "https://analyses.ezpaarse.org/platforms/632b48ac2cde73015cd63cd3", | ||
"domains": [ | ||
"research.ebsco.com", | ||
"viewer.ebscohost.com" | ||
], | ||
"version": "2025-02-11", | ||
"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,61 @@ | ||
#!/usr/bin/env node | ||
|
||
'use strict'; | ||
const Parser = require('../.lib/parser.js'); | ||
|
||
/** | ||
* Recognizes the accesses to the platform Ebsco Host 2025 | ||
* @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; | ||
let param = parsedUrl.query || {}; | ||
|
||
let match; | ||
|
||
if ((match = /^\/api\/search\/v[0-9]+\/search$/i.exec(path)) !== null) { | ||
// /api/search/v1/search?applyAllLimiters=true&includeSavedItems=false | ||
result.rtype = 'SEARCH'; | ||
result.mime = 'HTML'; | ||
} else if ((match = /^\/c\/[a-z0-9]+\/search\/details\/([a-z0-9]+)$/i.exec(path)) !== null) { | ||
// /c/dgznfn/search/details/w2sj2vnexn?db=asn&isDashboardExpanded=false&limiters=None&q=brain | ||
// /c/kczqeg/search/details/seiqme3mwr?db=kah%2Cmlf&isDashboardExpanded=false&limiters=None&q=A14 | ||
// /c/cp44gr/search/details/nsywpxxlmv?db=nlebk | ||
result.rtype = 'RECORD'; | ||
result.mime = 'HTML'; | ||
result.unitid = match[1]; | ||
result.db_id = param.db; | ||
} else if ((match = /^\/api\/search\/v[0-9]+\/details$/i.exec(path)) !== null) { | ||
// /api/search/v2/details?recordId=w2sj2vnexn&profileIdentifier=dgznfn | ||
result.rtype = 'RECORD'; | ||
result.mime = 'HTML'; | ||
result.unitid = param.recordId; | ||
} else if ((match = /^\/c\/[a-z0-9]+\/viewer\/(pdf|html)\/([a-z0-9]+)$/i.exec(path)) !== null) { | ||
// /c/dgznfn/viewer/pdf/w2sj2vnexn | ||
// /c/kczqeg/viewer/pdf/zcsn4yhmbv | ||
// /c/kczqeg/viewer/html/zcsn4yhmbv | ||
result.rtype = 'ARTICLE'; | ||
result.mime = match[1].toUpperCase(); | ||
result.unitid = match[2]; | ||
result.db_id = param.db; | ||
} else if ((match = /^\/api\/viewer\/v[0-9]+\/(details|htmlfulltext)\/([a-z0-9]+)$/i.exec(path)) !== null) { | ||
// /api/viewer/v5/details/w2sj2vnexn?opid=dgznfn | ||
// /api/viewer/v6/htmlfulltext/w2sj2vnexn?opid=dgznfn | ||
result.rtype = 'ARTICLE'; | ||
result.mime = match[1] === 'htmlfulltext' ? 'HTML' : 'PDF'; | ||
result.unitid = match[2]; | ||
} else if ((match = /^\/EbscoViewerService\/ebook$/i.exec(path)) !== null) { | ||
// /EbscoViewerService/ebook?an=157704&callbackUrl=https%3a%2f%2fresearch.ebsco.com&db=nlebk&format=EK&profId=eds&lpid=&ppid=&lang=fr&location=https%3a%2f%2fresearch-ebsco-com.ezproxy.unilim.fr%2fc%2fcp44gr%2fsearch%2fdetails%2fnsywpxxlmv%3fdb%3dnlebk&isPLink=False&requestContext=&profileIdentifier=cp44gr&recordId=nsywpxxlmv | ||
// /EbscoViewerService/ebook?an=157704&callbackUrl=https%3a%2f%2fresearch.ebsco.com&db=nlebk&format=EB&profId=eds&lpid=&ppid=&lang=fr&location=https%3a%2f%2fresearch-ebsco-com.ezproxy.unilim.fr%2fc%2fcp44gr%2fsearch%2fdetails%2fnsywpxxlmv%3fdb%3dnlebk&isPLink=False&requestContext=&profileIdentifier=cp44gr&recordId=nsywpxxlmv | ||
result.rtype = 'BOOK'; | ||
result.mime = param.format === 'EB' ? 'PDF' : 'HTML'; | ||
result.unitid = param.recordId; | ||
result.db_id = param.db; | ||
} | ||
|
||
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,11 @@ | ||
out-db_id;out-unitid;out-rtype;out-mime;in-url | ||
;;SEARCH;HTML;https://research-ebsco-com.inee.bib.cnrs.fr/api/search/v1/search?applyAllLimiters=true&includeSavedItems=false | ||
;w2sj2vnexn;RECORD;HTML;https://research-ebsco-com.inee.bib.cnrs.fr/api/search/v2/details?recordId=w2sj2vnexn&profileIdentifier=dgznfn | ||
;w2sj2vnexn;ARTICLE;PDF;https://research-ebsco-com.inee.bib.cnrs.fr/api/viewer/v5/details/w2sj2vnexn?opid=dgznfn | ||
kah,mlf;seiqme3mwr;RECORD;HTML;https://research.ebsco.com/c/kczqeg/search/details/seiqme3mwr?db=kah%2Cmlf&isDashboardExpanded=false&limiters=None&q=A14 | ||
;zcsn4yhmbv;ARTICLE;HTML;https://research-ebsco-com.ezproxy.unilim.fr/c/kczqeg/viewer/html/zcsn4yhmbv | ||
;zcsn4yhmbv;ARTICLE;PDF;https://research-ebsco-com.ezproxy.unilim.fr/c/kczqeg/viewer/pdf/zcsn4yhmbv | ||
nlebk;nsywpxxlmv;RECORD;HTML;https://research-ebsco-com.ezproxy.unilim.fr/c/cp44gr/search/details/nsywpxxlmv?db=nlebk | ||
nlebk;nsywpxxlmv;BOOK;HTML;https://viewer-ebscohost-com.ezproxy.unilim.fr/EbscoViewerService/ebook?an=157704&callbackUrl=https%3a%2f%2fresearch.ebsco.com&db=nlebk&format=EK&profId=eds&lpid=&ppid=&lang=fr&location=https%3a%2f%2fresearch-ebsco-com.ezproxy.unilim.fr%2fc%2fcp44gr%2fsearch%2fdetails%2fnsywpxxlmv%3fdb%3dnlebk&isPLink=False&requestContext=&profileIdentifier=cp44gr&recordId=nsywpxxlmv | ||
nlebk;nsywpxxlmv;BOOK;PDF;https://viewer-ebscohost-com.ezproxy.unilim.fr/EbscoViewerService/ebook?an=157704&callbackUrl=https%3a%2f%2fresearch.ebsco.com&db=nlebk&format=EB&profId=eds&lpid=&ppid=&lang=fr&location=https%3a%2f%2fresearch-ebsco-com.ezproxy.unilim.fr%2fc%2fcp44gr%2fsearch%2fdetails%2fnsywpxxlmv%3fdb%3dnlebk&isPLink=False&requestContext=&profileIdentifier=cp44gr&recordId=nsywpxxlmv | ||
;w2sj2vnexn;ARTICLE;HTML;https://research-ebsco-com.inee.bib.cnrs.fr/api/viewer/v6/htmlfulltext/w2sj2vnexn?opid=dgznfn |