{ "translatorID": "f203db7f-7b7b-4dc4-b018-115b7885fe3b", "label": "Oxford Music and Art Online", "creator": "Michael Berkowitz", "target": "^https?://([^/]+\\.)?www\\.oxford(music|art)online\\.com/", "minVersion": "1.0.0b4.r5", "maxVersion": "", "priority": 100, "inRepository": true, "translatorType": 4, "browserSupport": "gcsibv", "lastUpdated": "2015-06-02 21:05:15" } function detectWeb(doc, url) { if (url.match(/search_results/)) { return "multiple"; } else if (url.match(/\/article\//)) { return "journalArticle"; } } function doWeb(doc, url) { var host = doc.location.host; var site = host.match(/oxford(.*)online/)[1]; var ids = new Array(); if (detectWeb(doc, url) == "multiple") { var items = new Object(); var links = doc.evaluate('//ul[@class="search_result_list"]/li/p/a', doc, null, XPathResult.ANY_TYPE, null); var link; while (link = links.iterateNext()) { items[link.href] = link.textContent; } Zotero.selectItems(items, function (items) { if (!items) { return true; } for (var i in items) { ids.push(i.match(/(article)\/([^?]+)/)[2]); } scrape(ids, host); }); } else { ids = [url.match(/(article)\/([^?]+)/)[2]]; scrape(ids, host); } } function scrape(ids, host){ for (var i=0; i