Skip to content

Commit

Permalink
Update EBSCO DL Search (#3248)
Browse files Browse the repository at this point in the history
  • Loading branch information
adam3smith authored Feb 4, 2024
1 parent cc94c2f commit ac6628e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions EBSCO Discovery Layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated": "2023-11-27 04:12:52"
"lastUpdated": "2024-02-04 04:24:48"
}

/*
Expand Down Expand Up @@ -42,7 +42,7 @@ function detectWeb(doc, url) {
return "journalArticle";
}
Z.monitorDOMChanges(doc.querySelector('#page-container'));
let type = text(doc, 'div.article-type');
let type = text(doc, 'div[class*="article-type"]');
if (type) {
return getType(type);
}
Expand All @@ -60,7 +60,9 @@ function detectWeb(doc, url) {

function getType(type) {
// This can probably be fine-tuned, but it'll work for 90% of results
if (type.toLowerCase().includes("article")) {
type = type.toLowerCase();
// Z.debug(type)
if (type.includes("article") || type.includes("artikel")) {
return "journalArticle";
}
else {
Expand All @@ -73,6 +75,9 @@ function getSearchResults(doc, checkOnly) {
var found = false;

var rows = doc.querySelectorAll('h2.result-item-title > a');
if (!rows.length) {
rows = doc.querySelectorAll('div[class*="result-item-title"]>a');
}
for (let row of rows) {
let href = row.href;
let title = ZU.trimInternal(row.textContent);
Expand Down Expand Up @@ -138,6 +143,5 @@ async function scrape(doc, url = doc.location.href) {
}

/** BEGIN TEST CASES **/
var testCases = [
]

/** END TEST CASES **/

0 comments on commit ac6628e

Please sign in to comment.