{ "translatorID": "4fd6b89b-2316-2dc4-fd87-61a97dd941e8", "label": "Library Catalog (InnoPAC)", "creator": "Simon Kornblith and Michael Berkowitz", "target": "(search~|\\/search\\?|(a|X|t|Y|w)\\?|\\?(searchtype|searchscope)|frameset&FF|record=b[0-9]+(~S[0-9])?|/search/q\\?)", "minVersion": "2.1.9", "maxVersion": "", "priority": 250, "inRepository": true, "translatorType": 4, "browserSupport": "gcsibv", "lastUpdated": "2014-08-26 04:02:52" } function detectWeb(doc, url) { //*********** // URL MATCHING - translator should detect the following urls... // First page results // http://bearcat.baylor.edu/search~S7/?searchtype=t&searcharg=test&searchscope=7&sortdropdown=-&SORT=D&extended=0&SUBMIT=Search&searchlimits=&searchorigarg=tone+hundred+years+of+solitude // http://bearcat.baylor.edu/search~S7?/ttest/ttest/1837%2C1838%2C2040%2CB/browse/indexsort=- // http://innopac.cooley.edu/search~S0?/Xtest&SORT=DZ/Xtest&SORT=DZ&SUBKEY=test/1%2C960%2C960%2CB/browse // Individual item from search // http://bearcat.baylor.edu/search~S7?/ttest/ttest/1837%2C1838%2C2040%2CB/frameset&FF=ttestteori+english&1%2C1%2C/indexsort=- // http://innopac.cooley.edu/search~S0?/Xtest&SORT=DZ/Xtest&SORT=DZ&SUBKEY=test/1%2C960%2C960%2CB/frameset&FF=Xtest&SORT=DZ&1%2C1%2C // Persistent URL for item // http://bearcat.baylor.edu/record=b1540169~S7 // http://innopac.cooley.edu/record=b507916~S0 // http://libcat.dartmouth.edu/record=b4054652~S1 // Persistent URL for item, without suffix // http://luna.wellesley.edu/record=b2398784 // Specific search parameters // http://library.cooley.edu/search/q?author=shakespeare&title=hamlet //*********** // Central Michigan University fix var xpath = '//div[@class="bibRecordLink"]'; var elmt = doc.evaluate(xpath, doc, null, XPathResult.ANY_TYPE, null).iterateNext(); if(elmt) { return "book"; } // Regular expression to reduce false positives if (!url.match(/SEARCH=/) && !url.match(/searchargs?=/) && !url.match(/&FF/) && !url.match(/search~S[0-9]/) && !url.match(/\/search\/q\?/) && !url.match(/record=/)) return false; // First, check to see if the URL alone reveals InnoPAC, since some sites don't reveal the MARC button var matchRegexp = new RegExp('^https?://[^/]+/search[^/]*\\??/[^/]+/[^/]+/[^/]+\%2C[^/]+/frameset(.+)$'); if(matchRegexp.test(doc.location.href)) { if (!url.match("SEARCH") && !url.match("searchtype")) { return "book"; } } // Next, look for the MARC button xpath = '//a[img[@src="/screens/marc_display.gif" or @src="/screens/ico_marc.gif" or\ @src="/screens/marcdisp.gif" or starts-with(@alt, "MARC ") or\ @src="/screens/regdisp.gif" or\ @alt="REGULAR RECORD DISPLAY"]] |\ //a[span/img[@src="/screens/marc_display.gif" or\ @src="/screens/ico_marc.gif" or @src="/screens/marcdisp.gif" or\ starts-with(@alt, "MARC ") or @src="/screens/regdisp.gif" or\ @alt="REGULAR RECORD DISPLAY"]] |\ //a[contains(@href, "/marc~")]'; elmt = doc.evaluate(xpath, doc, null, XPathResult.ANY_TYPE, null).iterateNext(); if(elmt) { return "book"; } // Also, check for links to an item display page var tags = ZU.xpath(doc, '//a[@href]'); for(var i=0; i