Skip to content

Commit

Permalink
feat: add new parseur for torossa
Browse files Browse the repository at this point in the history
  • Loading branch information
felixleo22 committed Jan 14, 2025
1 parent 323f1de commit 829b840
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
6 changes: 6 additions & 0 deletions torrossa/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ module.exports = new Parser(function analyseEC(parsedUrl, ec) {
result.rtype = 'BOOK';
result.mime = 'PDF';
result.unitid = match[1];
} else if ((match = /^\/digital\/doc\/([0-9]+)_[a-z0-9.]+$/i.exec(path)) !== null) {
// /digital/doc/4443854_ab7000e724a.pdf
result.rtype = 'BOOK';
result.mime = 'PDF';
result.unitid = match[1];
result.title_id = match[1];
}

return result;
Expand Down
22 changes: 22 additions & 0 deletions torrossa/test/test.2025-01-14.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
out-title_id;out-unitid;out-rtype;out-mime;in-url
4443854;4443854;BOOK;PDF;https://access.torrossa.com/digital/doc/4443854_ab7000e724a.pdf
;2193653;ARTICLE;HTML;https://access.torrossa.com/it/resources/an/2193653?qt=any_keyword_search&q=Voltare&rows=100&sort=score+desc%2C+pub_date+desc%2C+title_sort+desc&start=100&page=1&publisher_code=FM0520&type=Search&itemnumber=77&rows_original=100&uri_original=%2Fit%2Fsearch%2F#
;2985059;BOOK;HTML;https://access.torrossa.com/it/catalog/readonline/2985059
;2985059;BOOK;PDF;https://access.torrossa.com/orders/review/2985059
;2200664;BOOK;HTML;https://access.torrossa.com/it/catalog/readonline/2200664
;2193689;ARTICLE;HTML;https://access.torrossa.com/it/resources/an/2193689?qt=any_keyword_search&q=Voltare&rows=50&sort=score+desc%2C+pub_date+desc%2C+title_sort+desc&start=0&page=0&publisher_code=FM0520&type=Search&itemnumber=1&rows_original=50&uri_original=%2Fit%2Fsearch%2FVoltare#
;2200664;BOOK;PDF;https://access.torrossa.com/orders/review/2200664
;;SEARCH;HTML;https://access.torrossa.com/it/search/Voltare
;;SEARCH;HTML;https://access.torrossa.com/it/search/?q=Einstein
;5363707;BOOK;HTML;https://oa.torrossa.com/it/catalog/readonline/5363707
;5462110;BOOK;HTML;https://oa.torrossa.com/it/catalog/readonline/5462110
;;SEARCH;HTML;https://oa.torrossa.com/it/search/marins
;;SEARCH;HTML;https://oa.torrossa.com/it/search/Virus
;5592583;BOOK;HTML;https://www.torrossa.com/it/catalog/preview/5592583
;5592583;BOOK;PDF;https://www.torrossa.com/it/catalog/download/5592583
;5453152;BOOK;HTML;https://www.torrossa.com/it/catalog/preview/5453152
;5453152;BOOK;PDF;https://www.torrossa.com/it/catalog/download/5453152
;2236976;ARTICLE;PDF;https://www.torrossa.com/it/resources/an/2236976
;2236975;ARTICLE;PDF;https://www.torrossa.com/en/resources/an/2236975
;;SEARCH;HTML;https://www.torrossa.com/en/search/Computer%20Science
;;SEARCH;HTML;https://www.torrossa.com/en/search/Java

0 comments on commit 829b840

Please sign in to comment.