{ "translatorID": "5f0ca39b-898a-4b1e-b98d-8cd0d6ce9801", "label": "Airiti", "creator": "Aurimas Vinckevicius", "target": "^https?://(?:[^/]+\\.)?airitilibrary\\.com/Publication/alDetailedMesh", "minVersion": "3.0", "maxVersion": "", "priority": 110, "inRepository": true, "translatorType": 12, "browserSupport": "gcsib", "lastUpdated": "2014-05-24 08:05:07" } function detectWeb(doc, url) { // How can we distinguish thesis from journal article?? if(ZU.xpathText(doc, '/html/head/meta[@name="citation_title"]/@content')) { return 'journalArticle'; } } function getDocId(url) { var m = url.match(/\bDocID=([^&#]+)/); if(!m) return; return m[1]; } function doWeb(doc, url) { var docID = getDocId(url); scrape([docID], function(item) { if(!item.url) { // Maybe we shouldn't. Looks more like a catalog. item.url = url; } item.attachments.push({ title: 'Snapshot', document: doc }) item.complete(); }); } function scrape(docIDs, itemDoneHandler) { var bibTeXUrl = buildQuery(docIDs) ZU.doGet(bibTeXUrl, function(text) { var translator = Zotero.loadTranslator("import"); // BibTeX translator.setTranslator("9cb70025-a888-4a29-a210-93ec52da40d4"); translator.setString(text); translator.setHandler('itemDone', function(obj, item) { // Chinese names are not split correctly // Sometimes, English name is provided as well in parentheses for(var i=0, n=item.creators.length; i 1) { c.firstName = name.substr(0, name.length-1); } else { delete c.firstName; c.fieldMode = 1; } } // language is sometimes written in chinese // use "zh", since I think dialect actually varies in this catalog item.language = "zh"; // search- and web-specific itemDone handlers if(itemDoneHandler) itemDoneHandler(item); else item.complete(); }); translator.translate(); }); } function buildQuery(docIDs) { var url = '/publication/ExportTo?ExportType=BibTex' + '¶meter=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16' for(var i=0; i