diff --git a/translators/3news.co.nz.js b/translators/3news.co.nz.js deleted file mode 100644 index 279a0fe81..000000000 --- a/translators/3news.co.nz.js +++ /dev/null @@ -1,230 +0,0 @@ -{ - "translatorID": "a9f7b277-e134-4d1d-ada6-8f7942be71a6", - "label": "3news.co.nz", - "creator": "Sopheak Hean", - "target": "^https?://www\\.3news\\.co\\.nz", - "minVersion": "1.0", - "maxVersion": "", - "priority": 100, - "inRepository": false, - "translatorType": 4, - "lastUpdated": "2011-04-21 09:17:38" -} - -/* - 3news.co.nz Translator- Parses 3news.co.nz articles and creates Zotero-based metadata - Copyright (C) 2011 Sopheak Hean, University of Waikato, Faculty of Education - Contact: maxximuscool@gmail.com - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -function detectWeb(doc, url) { - var namespace = doc.documentElement.namespaceURI; - var nsResolver = namespace ? function(prefix) { - if (prefix == "x" ) return namespace; else return null; - } : null; - - var blog= '//div[@class="newsWrapperDisp"]/div[@class="news"]/span'; - var blogObject = doc.evaluate(blog, doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext(); - if (blogObject){ - return "blogPost"; - } else { - var date='//div[@class="ModArticleDisplayC"]/div[@class="newsWrapperFullDisp09"]/div[@class="news"]/span'; - var dateObject = doc.evaluate(date, doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext(); - if (dateObject){ - return "newspaperArticle"; - } - } - return false; -} - -function scrape (doc, url) { - var namespace = doc.documentElement.namespaceURI; - var nsResolver = namespace ? function(prefix) { - if (prefix == 'x') return namespace; else return null; - } : null - - if (detectWeb(doc, url) =="newspaperArticle"){ - var newItem = new Zotero.Item('newspaperArticle'); - newItem.url = doc.location.href; - newItem.publicationTitle = "3news.co.nz"; - newItem.language = "English"; - - if (dodate(doc, url) !=null){ - newItem.date = dodate(doc, url); - } - - if (doAbstract(doc, url) != null) { - newItem.abstractNote= doAbstract(doc, url); - } - var au = '//div[@id="newsbody"]/p/strong'; - var author = doAuthor(doc, url, au); - var title = '//h1'; - if (doTitle(doc, url, title) !=null){ - newItem.title = doTitle(doc, url, title); - } - if (author != null){ - - newItem.creators.push(Zotero.Utilities.cleanAuthor(author, "author")); - } - - if(doSection(doc,url) !=null){ - newItem.section = doSection(doc,url); - } - if(doCopyright(doc,url) !=null){ - newItem.rights = doCopyright(doc,url); - } - newItem.attachments.push({title:"3news.co.nz Snapshot", mimeType:"text/html", url:newItem.url}); - newItem.complete(); - } - - - else if (detectWeb(doc,url) =="blogPost"){ - var newItem = new Zotero.Item('blogPost'); - newItem.url = doc.location.href; - //newItem.publicationTitle = "3news.co.nz"; - newItem.language = "English"; - if (doAbstract(doc, url) != null) { - newItem.abstractNote= doAbstract(doc, url); - } - if (dodate(doc, url) !=null){ - newItem.date = dodate(doc, url); - } - var title = '//h1'; - if (doTitle(doc, url, title) !=null){ - newItem.title = doTitle(doc, url, title); - } - var author ='//div[@class="news"]/p/strong'; - if (doAuthor(doc, url, author) != null){ - newItem.creators.push(Zotero.Utilities.cleanAuthor(doAuthor(doc, url, author), "author")); - } - if(doSection(doc,url) !=null){ - newItem.section = doSection(doc,url); - } - if(doCopyright(doc,url) !=null){ - newItem.rights = doCopyright(doc,url); - } - newItem.attachments.push({title:"3news.co.nz Snapshot", mimeType:"text/html", url:newItem.url}); - newItem.complete(); - - } -} - -function doSection (doc, url) { - var namespace = doc.documentElement.namespaceURI; - var nsResolver = namespace ? function(prefix) { - if (prefix == 'x') return namespace; else return null; - } : null; - - var section = '//div[@id="newsBreadCrumb"]/span/a[1]'; - var sectionObject =doc.evaluate(section, doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext(); - if(sectionObject){ - return sectionObject.textContent; - } else return null; -} - -function dodate ( doc, url ) { - var namespace = doc.documentElement.namespaceURI; - var nsResolver = namespace ? function(prefix) { - if (prefix == 'x') return namespace; else return null; - } : null; - - var date='//div[@class="ModArticleDisplayC"]/div/div[@class="news"]/span'; - var dateObject = doc.evaluate(date, doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext(); - if (dateObject){ - dateObject = dateObject.textContent.replace(/\s(\d:{0,9})+:(\d{0,9})+([a-zA-Z.]{1,4})/, ''); - return dateObject; - } else return null; -} - -function doTitle(doc, url, title){ - var namespace = doc.documentElement.namespaceURI; - var nsResolver = namespace ? function(prefix) { - if (prefix == 'x') return namespace; else return null; - } : null; - var titleObject = doc.evaluate(title, doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext(); - if (titleObject){ - var articleTitle= titleObject.textContent; - return articleTitle; - } - else return null; -} - - -function doAuthor(doc, url, author){ - var namespace = doc.documentElement.namespaceURI; - var nsResolver = namespace ? function(prefix) { - if (prefix == 'x') return namespace; else return null; - } : null; - - var author2 = author; - var authorObject = doc.evaluate(author2, doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext(); - if (authorObject){ - authorObject= authorObject.textContent.replace(/By\s/, ''); - return authorObject; - } - else return null; -} - - -function doAbstract(doc, url){ - var namespace = doc.documentElement.namespaceURI; - var nsResolver = namespace ? function(prefix) { - if (prefix == 'x') return namespace; else return null; - } : null; - - - var a= "//meta[@name='DESCRIPTION']"; - var abs= doc.evaluate(a, doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext(); - if (abs){ - var abstractString = abs.content; - return abstractString; - - } - else return null; - -} - -function doCopyright(doc, url){ - var namespace = doc.documentElement.namespaceURI; - var nsResolver = namespace ? function(prefix) { - if (prefix == 'x') return namespace; else return null; - } : null; - - var CP = '//meta[@name="COPYRIGHT"]'; - var copyrightObject = doc.evaluate(CP, doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext(); - if (copyrightObject){ - return copyrightObject.content; - - } - else return null; -} - -function doWeb(doc, url) { - var namespace = doc.documentElement.namespaceURI; - var nsResolver = namespace ? function(prefix) { - if (prefix == 'x') return namespace; else return null; - } : null; - - - var articles = new Array(); - if (detectWeb(doc, url) == "newspaperArticle" || detectWeb(doc, url) == "blogPost") { - scrape(doc, url); - } else { - /** Multiple cannot be done for this translator **/ - Zotero.Utilities.processDocuments(articles, scrape, function() {Zotero.done();}); - Zotero.wait(); - } -} diff --git a/translators/A Contra Corriente.js b/translators/A Contra Corriente.js deleted file mode 100644 index 0f9bc585e..000000000 --- a/translators/A Contra Corriente.js +++ /dev/null @@ -1,48 +0,0 @@ -{ - "translatorID":"bbf1617b-d836-4665-9aae-45f223264460", - "translatorType":4, - "label":"A Contra Corriente", - "creator":"Michael Berkowitz", - "target":"http://www.ncsu.edu/project/acontracorriente", - "minVersion":"1.0.0b4.r5", - "maxVersion":"", - "priority":100, - "inRepository":true, - "lastUpdated":"2008-06-03 19:40:00" -} - -function detectWeb(doc, url) { - if (doc.evaluate('//tr[td[1]//img][td[3]]', doc, null, XPathResult.ANY_TYPE, null).iterateNext()) { - return "multiple"; - } -} - -function doWeb(doc, url) { - var arts = doc.evaluate('//tr[td[1]//img][td[3]]', doc, null, XPathResult.ANY_TYPE, null); - var art; - var selectList = new Object(); - var items = new Object(); - while (art = arts.iterateNext()) { - var item = new Object(); - var title = doc.evaluate('.//a', art, null, XPathResult.ANY_TYPE, null).iterateNext(); - item['title'] = Zotero.Utilities.trimInternal(title.textContent); - item['pdfurl'] = title.href; - item['author'] = doc.evaluate('.//strong', art, null, XPathResult.ANY_TYPE, null).iterateNext().textContent; - selectList[item.title] = item.title; - items[item.title] = item; - } - var selected = Zotero.selectItems(selectList); - var voliss = Zotero.Utilities.trimInternal(doc.evaluate('//td[@class="red01"]/font[2]/strong', doc, null, XPathResult.ANY_TYPE, null).iterateNext().textContent); - voliss = voliss.match(/Vol\.\s+(\d+),\s+No\.\s+(\d+)\.\s+([^|]+)|/); - Zotero.debug(voliss); - for each (var title in selected) { - var item = new Zotero.Item("journalArticle"); - var olditem = items[title]; - item.title = olditem.title; - item.creators = [Zotero.Utilities.cleanAuthor(olditem.author, "author")]; - item.volume = voliss[1]; - item.issue = voliss[2] - item.date = Zotero.Utilities.trimInternal(voliss[3]); - item.complete(); - } -} \ No newline at end of file diff --git a/translators/ABC-CLIO Serials Web.js b/translators/ABC-CLIO Serials Web.js deleted file mode 100644 index c8f27be7a..000000000 --- a/translators/ABC-CLIO Serials Web.js +++ /dev/null @@ -1,141 +0,0 @@ -{ - "translatorID":"a07bb62a-4d2d-4d43-ba08-d9679a0122f8", - "translatorType":4, - "label":"ABC-CLIO Serials Web", - "creator":"Simon Kornblith", - "target":"https?://[^/]*serials\\.abc-clio\\.com[^/]*/active/go/ABC-Clio-Serials_v4", - "minVersion":"1.0.0b3.r1", - "maxVersion":"", - "priority":100, - "inRepository":true, - "lastUpdated":"2011-01-11 04:31:00" -} - -function detectWeb(doc, url) { - var namespace = doc.documentElement.namespaceURI; - var nsResolver = namespace ? function(prefix) { - if (prefix == 'x') return namespace; else return null; - } : null; - - var result = doc.evaluate('//table[@class="rc_main"]', doc, nsResolver, - XPathResult.ANY_TYPE, null).iterateNext(); - if(result) { - return "multiple"; - } -} - -function doWeb(doc, url) { - var namespace = doc.documentElement.namespaceURI; - var nsResolver = namespace ? function(prefix) { - if (prefix == 'x') return namespace; else return null; - } : null; - - var availableItems = new Array(); - var availableAttachments = new Array(); - - var elmts = doc.evaluate('//table[@class="rc_main"]', doc, nsResolver, - XPathResult.ANY_TYPE, null); - var elmt; - while(elmt = elmts.iterateNext()) { - var title = doc.evaluate('./tbody/tr/td[b/text() = "Title:"]', - elmt, nsResolver, XPathResult.ANY_TYPE, null).iterateNext(); - var checkbox = doc.evaluate('.//input[@type = "checkbox"]', - elmt, nsResolver, XPathResult.ANY_TYPE, null).iterateNext(); - if(title, checkbox) { - checkbox = checkbox.name; - availableItems[checkbox] = Zotero.Utilities.trimInternal(title.textContent).substr(6); - - var links = doc.evaluate('./tbody/tr/td[b/text() = "Fulltext: ["]/a', - elmt, nsResolver, XPathResult.ANY_TYPE, null); - var link; - - var attach = new Array(); - while(link = links.iterateNext()) { - attach.push({url:link.href, title:Zotero.Utilities.trimInternal(link.textContent)+" Full Text", - mimeType:"text/html"}); - } - availableAttachments[checkbox] = attach; - } - } - - var items = Zotero.selectItems(availableItems); - - if(!items) { - return true; - } - - var postString = "_defaultoperation=Download+Options&research_field=&research_value=&jumpto="; - var attachments = new Array(); - for(var i in availableItems) { - postString += "&_checkboxname="+i+(items[i] ? "&"+i+"=1" : ""); - if(items[i]) { - attachments.push(availableAttachments[i]); - } - } - - Zotero.Utilities.HTTP.doPost(url, postString, function(text) { - Zotero.Utilities.HTTP.doPost(url, "_appname=serials&_defaultoperation=Download+Documents&_formname=download&download_format=citation&download_which=tagged&download_where=ris&mailto=&mailreplyto=&mailsubject=&mailmessage=", - function(text) { - // get link - var linkRe = /-1) - // return "journalArticle"; - // else - // return "conferencePaper"; -} - - -function scrapeIndex(doc, items) { - var results; - var doImport; - - if (items != null) { // Import user-selected item(s) - results = items; - doImport = true; - } - else { - bibFileNodes = doc.evaluate('//a[substring(@href, string-length(@href)-3, 4) = ".bib"]', doc, null, XPathResult.ANY_TYPE, null); - - results = new Array(); - doImport = false; - - var bibFileNode = bibFileNodes.iterateNext(); - - while (bibFileNode) { - var bibFileName = bibFileNode.getAttribute("href"); - var bibFile = bibFileName.substring(0, bibFileName.length-4); - - var bNodes = doc.evaluate('//a[@href="' + bibFileName + '"]/following-sibling::b[position()=1]', doc, null, XPathResult.ANY_TYPE, null); // These nodes contain author information - - // Extract authors' last names - var authorLasts = new Array(); - - var bNode = bNodes.iterateNext(); - var authorsS = bNode.innerHTML; // may include markup: potentially , , , and/or tags - authorsS = authorsS.replace(/[<][/]?author[>]/g, ""); - var authors = authorsS.split("; "); - for (var a in authors) { - var authorS = authors[a]; - var m = authorS.match(/[<]von[>]([^<]+)[<][/]von[>]/); - var last = ""; - if (m!=null) // we expect there is a tag if there is a tag - last = m[1] + " "; - m = authorS.match(/[<]last[>]([^<]+)[<][/]last[>]/); - if (m!=null) - last += m[1]; - else { - var name = authorS.replace(/[<][^>]+[>]/g, ""); // remove all markup - if (name=="Entire volume") - last = name; - else { - var parts = name.split(" "); - last = parts[parts.length-1]; - if (parts.length>1) { - var penultInitial = parts[parts.length-2].substr(0,1); - if (penultInitial.toUpperCase()!=penultInitial) // e.g. van Dyke - last = name[parts.length-2] + " " + last; - } - } - } - authorLasts.push(last); - } - - // Prepare result for this item, which consists of the relative path to the .bib file (minus the extension) - // followed by a space and the authors' last names (abbreviated format) - var result = bibFile + " "; - - if (authorLasts.length<3) - result += authorLasts.join(" & "); - else - result += authorLasts[0] + "+"; - - results.push(result); - bibFileNode = bibFileNodes.iterateNext(); - } - } - - - if (!doImport) - return results; - - for (var i in results) { - var ii = results[i].indexOf(" "); - var fileRelPath = results[i].substring(0, ii); - var authorsShort = results[i].substring(ii+1); - var fileName = fileRelPath.substring(fileRelPath.lastIndexOf("/")+1); - var bibFile = fileRelPath + ".bib"; - - var pageurl = doc.location.href; - var lastSlash = pageurl.lastIndexOf("/"); - var dirInUrl = pageurl.substring(0, lastSlash+1); - var fileInUrl = pageurl.substring(lastSlash+1, pageurl.indexOf("#", lastSlash)); - var bib = dirInUrl + fileRelPath + ".bib"; - var pdf = dirInUrl + fileRelPath + ".pdf"; - var j = fileRelPath.lastIndexOf("-"); - var yearShort = fileRelPath.substring(j-2, j); - var year = ""; - if (new Number(yearShort) < 50) - year = "20" + yearShort; - else - year = "19" + yearShort; - - var attachments = new Array(); - attachments.push({title:authorsShort + " " + year + ".pdf", mimeType:"application/pdf", url:pdf}); - - var type = ""; - if (pageurl.indexOf("/anthology-new/J/")>-1) - type = "journalArticle"; - else - type = "conferencePaper"; - - if (doImport) - callTranslator(bib, type, attachments); - - } -} - -function callTranslator(bibFileURL, type, attachments) { - Zotero.Utilities.HTTP.doGet(bibFileURL, function(text) { - - // load BibTex translator - var translator = Zotero.loadTranslator("import"); - translator.setTranslator("9cb70025-a888-4a29-a210-93ec52da40d4"); - translator.setString(text); - translator.setHandler("itemDone", function(obj, item) { - item.itemType = type; - item.attachments = attachments; - item.repository = "Association for Computational Linguistics" - item.complete(); - }); - translator.translate(); - - }); -} - -function doWeb(doc, url) { - var searchResult = true; - if(searchResult) { - var possibleItems = scrapeIndex(doc, null); // items to present to user - - items = Zotero.selectItems(possibleItems); // items selected by the user - if(!items) return true; - - scrapeIndex(doc, items); - - } else { - //not implemented yet - scrape(doc); - } - - Zotero.wait(); -} diff --git a/translators/ACM.js b/translators/ACM.js deleted file mode 100644 index e87bc875b..000000000 --- a/translators/ACM.js +++ /dev/null @@ -1,415 +0,0 @@ -{ - "translatorID": "f3f092bf-ae09-4be6-8855-a22ddd817925", - "label": "ACM Digital Library", - "creator": "Simon Kornblith, Michael Berkowitz and John McCaffery", - "target": "^https?://[^/]*portal\\.acm\\.org[^/]*/(?:results\\.cfm|citation\\.cfm)", - "minVersion": "1.0", - "maxVersion": "", - "priority": 100, - "inRepository": true, - "translatorType": 4, - "lastUpdated": "2011-06-10 01:14:01" -} - -/** - * The XPath for all the search result elements - */ -var searchResultX = '//td[@colspan="3"]/a[@class="medium-text" and @target="_self"]'; -/** - * The XPath for all the journal TOC elements - */ -var tocResultX = '//td[@colspan="1"]/span[@style]/a[contains(@href,"citation.cfm")]'; - -/** - * The XPath for the tag elements in a justified format tags list - */ -var justifiedTagX = '//div[@id="divtags"]/p/a'; -/** - * The XPath for the tag elements in an un-justified format tags list - */ -var unjustifiedTagX = '//div[@id="divtags"]/a'; -/** - * the XPath for the "more tags" link element - */ -var moreTagsX = '//a[@href="javascript:ColdFusion.Window.show(' + "'thetags'" + ')"]'; -/** - * the XPath for the tag elements in the "more tags" popup - */ -var moreTagX = '//a/span[@class="small-text"]'; -/** - * the XPath for the title heading element - not strictly necessary, more helpful for debugging - */ -var titleX = '//div[@class="large-text"]/h1[@class="mediumb-text"]/strong'; -/** - * XPath for Table of Contents headline for journal issue - */ -var tocX = "//div[@id='citationdetails']//h5[@class='medium-text' and contains(.,'Table of Contents')]"; - - - -/** - * Scan to see what type of page this is - * @param doc The XML document describing the page - * @param url The URL of the page being scanned - * @return What type of article this page is (multiple, journal or conference proceedings) - */ -function detectWeb(doc, url) { - var nsResolver = getNsResolver(doc); - var title = getText(titleX, doc, nsResolver); - Zotero.debug("Title: " + title); - - if(url.indexOf("/results.cfm") != -1) { - Zotero.debug("Multiple items detected"); - return "multiple"; - } else if (url.indexOf("/citation.cfm") != -1) { - Zotero.debug("Single item detected"); - return getArticleType(doc, url, nsResolver); - /* - var type = getArticleType(doc, url, nsResolver); - if (type .indexOf("conferencePaper") != -1) { - return "conferencePaper"; - } else - return "journalArticle"; - }*/ - } -} - -/** - * Parse the page - * @param doc The XML document describing the page - * @param url The URL of the page being scanned - */ -function doWeb(doc, url) { - var nsResolver = getNsResolver(doc, url); - - //If there are multiple pages - if (getArticleType(doc, url) == "multiple") { - //If this is a search results page - if (url.indexOf("results.cfm") != -1) - scrapeMulti(doc, url, nsResolver, "search"); - else if(getText(tocX, doc, nsResolver) =="Table of Contents") - scrapeMulti(doc, url, nsResolver, "toc"); - Zotero.wait(); - } //If this is a single page - else - scrape(doc, url, nsResolver); -} - -/** - * Scrape search results and journal tables of contents - * @param doc The XML document describing the page - * @param url The URL of the page being scanned - * @param nsResolver the namespace resolver function - * @param type Type of result-- "search" or "toc" - */ -function scrapeMulti(doc, url, nsResolver, type) { - switch(type) { - case "toc": - Zotero.debug("Scraping journal TOC"); - var resultPath= doc.evaluate(tocResultX, doc, null, XPathResult.ANY_TYPE, null); - break; - case "search": - Zotero.debug("Scraping search"); - default: - var resultPath= doc.evaluate(searchResultX, doc, null, XPathResult.ANY_TYPE, null); - } - - //Count how mange pages have been scraped - var node; - var urls = {}; - //Iterate through all the results - while(node= resultPath.iterateNext()) { - urls[node.href + '&preflayout=flat'] = node.textContent; - } - - var items = Zotero.selectItems(urls); - if(!items) return true; - - var i; - urls = []; - for (i in items) urls.push(i); - - Zotero.Utilities.processDocuments(urls, scrape, function(){Zotero.done()}); -} - -/** - * Scrape a single page - * @param doc The XML document describing the page - */ -function scrape(doc) { - var url = doc.location.href; - var nsResolver = getNsResolver(doc, url); - - //Get all the details not scraped from the bibtex file - var tags = scrapeKeywords(doc); - var attachments = scrapeAttachments(doc, url); - var abs = scrapeAbstract(doc); - // Type not used, since it was less reliable than BibTeX - var type = getArticleType(doc, url, nsResolver); - // Manual journal not used. Some pieces are multiply published, see http://portal.acm.org/citation.cfm?id=52400.52432&coll=DL&dl=GUIDECFID=16073284&CFTOKEN=77905982 - // and also http://forums.zotero.org/discussion/17532/ - var journal = getText("//meta[@name='citation_journal_title']/@content",doc, nsResolver); - //Get the bibtex reference for this document as a string - var bibtex = scrapeBibtex(url, nsResolver); - - //Create the new item - var newItem = new Zotero.Item(type); - - //Use the bibtex translator to parse the bibtex string - var translator = Zotero.loadTranslator("import"); - translator.setTranslator("9cb70025-a888-4a29-a210-93ec52da40d4"); - translator.setString(bibtex ); - //Set the function to run when the bibtex string has been parsed - translator.setHandler("itemDone", function(obj, newItem) { - //Store all details not parsed from the bibtex - if(abs) newItem.abstractNote = abs; - newItem.tags = tags; - newItem.attachments = attachments; - // There were issues with grabbing type from the page; - // see http://forums.zotero.org/discussion/17246/ - //newItem.itemType= type; - /*if (journal && journal != newItem.publicationTitle) { - newItem.journalAbbreviation = newItem.publicationTitle; - newItem.publicationTitle = journal; - }*/ - // If the URL is just a DOI, clear it. - if (newItem.url && newItem.url.match(/^http:\/\/doi\.acm\.org\//)) newItem.url = ""; - if (newItem.DOI) newItem.DOI = newItem.DOI.replace(/^http:\/\/doi\.acm\.org\//, ''); - var acmid = bibtex.match(/acmid = {(\d+)}/); - if(acmid) newItem.extra = "ACM ID: "+ acmid[1]; - newItem.place = newItem.archiveLocation; - newItem.archiveLocation = null; - //Complete the parsing of the page - newItem.complete(); - }); - - //Trigger the translation - translator.translate(); -} - -/** - * Scrape all keywords attached to this document - * @param doc The XML document describing the page - * @return an array of all keywords attached to this document - */ -function scrapeKeywords(doc) { - Zotero.debug("Scraping Keywords"); - //Try scraping keywords from the "more keywords" popup - var keywords = scrapeMoreTagsKeywords(doc); - - if (keywords) return keywords; - - keywords = new Array(); - - //Otherwise look for the keywords - check justified format - var keywordPath = doc.evaluate(justifiedTagX, doc, null, XPathResult.ANY_TYPE, null); - var keywordNode = keywordPath.iterateNext(); - //If justified format didn't work check unjustified - if (!keywordNode) { - keywordPath = doc.evaluate(unjustifiedTagX, doc, null, XPathResult.ANY_TYPE, null); - keywordNode = keywordPath.iterateNext(); - } - //Iterate through all the keywords - while(keywordNode) { - keywords.push(Zotero.Utilities.trimInternal(keywordNode .textContent.toLowerCase())); - Zotero.debug("Keyword: " + keywordNode .textContent.toLowerCase()); - keywordNode = keywordPath.iterateNext(); - } - - return keywords; -} - -/** - * Scrape keywords from a "more tags" popup - * @param doc The XML document describing the page - * @return an array of all the keywords attached to the page which will be used as the tags for the document - */ -function scrapeMoreTagsKeywords(doc) { - var keywords = new Array(); - - //Look for a link for a javascript code for a "more tags" popup - var morePath = doc.evaluate(moreTagsX, doc, null, XPathResult.ANY_TYPE, null); - var moreNode = morePath ? morePath.iterateNext() : null; - //If there is no "more tags" popup - if (!moreNode) - return null; - - var keywordPath = doc.evaluate(moreTagX, doc, null, XPathResult.ANY_TYPE, null); - - var keywordNode; - //Iterate through all the keywords - while(keywordNode = keywordPath.iterateNext()) { - keywords.push(Zotero.Utilities.trimInternal(keywordNode .textContent.toLowerCase())); - Zotero.debug("Keyword: " + keywordNode .textContent.toLowerCase()); - } - return keywords; -} - -/** - * Scrape all the relevant attachments from the page. - * Firstly grabs a snapshot of the ACM page then looks for any links to the full text - * @param doc The XML document describing the page - * @param url The URL of the page being scanned - * @return an array of all the attachments - */ -function scrapeAttachments(doc, url) { - Zotero.debug("Scraping attachments"); - var attachments = new Array(); - - //Add the scrapeshot of this page - attachments.push({title:"ACM Snapshot", mimeType:"text/html", url:url}); - - //XPath for the full text links - var textPath = doc.evaluate('//a[@name="FullTextPdf" or @name="FullTextHtml" or @name="FullText Html"][not(ancestor::div[@class="flatbody"])]', doc, null, XPathResult.ANY_TYPE, null); - - var textNode; - //Iterate through all the links - while (textNode= textPath .iterateNext()) { - var textURL= textNode.href; - - //If the full text is a pdf - if (textNode.name == "FullTextPdf") { - Zotero.debug("Text PDF: " + textURL); - attachments.push({title:"ACM Full Text PDF", mimeType:"application/pdf", url:textURL}); - } else { //Otherwise the text is an HTML link - Zotero.debug("Text Page: " + textURL); - attachments.push({title:"ACM Full Text HTML", mimeType:"text/html", url:textURL}); - } - - // Break at a reasonable limit - if (attachments.length > 20) return attachments; - } - - return attachments; -} - -/** - * Scrape the abstract from the page - * @param doc The XML document describing the page - * @param url The URL of the page being scanned - * @return a string with the text of the abstract - */ -function scrapeAbstract(doc) { - Zotero.debug("Scraping abstract"); - var text = getText('//div[@class="flatbody" or @class="tabbody"]', doc); - return Zotero.Utilities.trimInternal(text); -} - -/** - * Get the text of the bibtex format reference - * @param url The URL of the page being scanned - * @param nsResolver the namespace resolver function - * @return the bibtex reference as a trimmed string - */ -function scrapeBibtex(url, nsResolver) { - Zotero.debug("Scraping full details from bibtex"); - //Get the ID of this document - var id = getId(url); - //The link of the bibtex popup - var bibtex = "http://portal.acm.org/exportformats.cfm?id=" + id + "&expformat=bibtex"; - - Zotero.debug("Bibtex: " + bibtex); - - //Get the xml document which will be loaded into the popup box - var texDoc = Zotero.Utilities.retrieveDocument(bibtex); - //Find the node with the bibtex text in it - var path = texDoc.evaluate('//pre', texDoc, nsResolver, XPathResult.ANY_TYPE, null); - var node = path.iterateNext(); - - if (node != null && node.textContent != null) { - var ref = node.textContent; - Zotero.debug("\nref : " + (ref == null ? "null":ref)); - ref = Zotero.Utilities.trimInternal(ref); - ref = Zotero.Utilities.trim(ref); - return ref; - } - return null; -} - -/** - * Get the unique identifier of this document - * @param url The URL of the page being scanned - * @param journal [optional]whether to get the ID of the journal the document is in or of the document itself - * @return a string containing the identifier of the document or journal the document is in - */ -function getId(url, journal) { - if (journal=== undefined) - journal= false; - - var cfmIndex = url.indexOf(".cfm"); - var atIndex = url.indexOf('&'); - - var id = url.substr(cfmIndex + 8); - - if (atIndex != -1) - id = id.replace(url.substring(atIndex), ""); - - var dotIndex = id.indexOf('.'); - if (dotIndex != -1) - if (!journal) - id = id.replace(id .substring(0, (dotIndex+1)), ""); - else - id = id.replace(id .substring(dotIndex), ""); - - return id; -} - -/** - * Find out what kind of document this is - * @param doc The XML document describing the page - * @param url The URL of the page being scanned - * @param nsResolver the namespace resolver function - * @return a string with either "multiple", "journalArticle" or "conferencePaper" in it, depending on the type of document - */ -function getArticleType(doc, url, nsResolver) { - var toc = doc.evaluate(tocX, doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext(); - if (url.indexOf("results.cfm") != -1 || toc) { - Zotero.debug("Type: multiple"); - return "multiple"; - } - - //XPath for the table cell which has either "Journal" or "Proceeding" in it - var text = getText('//td[@nowrap="nowrap" and @style="padding-bottom: 0px;"]', doc, nsResolver); - - Zotero.debug("Type: " + text); - if (text.indexOf("Proceeding") != -1) - return "conferencePaper"; - else if (text.indexOf("Magazine") != -1) - return "magazineArticle"; - else - return "journalArticle"; - -} - -/** - * Get the text from the first node defined by the given xPathString - * @param pathString the XPath indicating which node to get the text from - * @param doc The XML document describing the page - * @param nsResolver the namespace resolver function - * @return the text in the defined node or "Unable to scrape text" if the node was not found or if there was no text content - */ -function getText(pathString, doc, nsResolver) { - var path = doc.evaluate(pathString, doc, nsResolver, XPathResult.ANY_TYPE, null); - var node = path.iterateNext(); - - if (node == null || node.textContent == undefined || node.textContent == null) { - Zotero.debug("Unable to retrieve text for XPath: "+pathString); - return ""; - } - - return node.textContent; -} - -/** - * Get a function for returning the namespace of a given document given its prefix - * @param nsResolver the namespace resolver function - */ -function getNsResolver(doc) { - var namespace = doc.documentElement.namespaceURI; - var nsResolver = namespace ? function(prefix) { - if (prefix == 'x') return namespace; - else return null; - } : null; - - return nsResolver; -} diff --git a/translators/ACS Publications.js b/translators/ACS Publications.js deleted file mode 100644 index 0468746dd..000000000 --- a/translators/ACS Publications.js +++ /dev/null @@ -1,117 +0,0 @@ -{ - "translatorID":"938ebe32-2b2e-4349-a5b3-b3a05d3de627", - "translatorType":4, - "label":"ACS Publications", - "creator":"Sean Takats and Michael Berkowitz and Santawort", - "target":"http://[^/]*pubs3?.acs.org[^/]*/(?:wls/journals/query/(?:subscriberResults|query)\\.html|acs/journals/toc.page|cgi-bin/(?:article|abstract|sample|asap).cgi)?", - "minVersion":"1.0.0b3.r1", - "maxVersion":"", - "priority":100, - "inRepository":true, - "lastUpdated":"2011-06-04 19:20:00" -} - -function detectWeb(doc, url) { - var namespace = doc.documentElement.namespaceURI; - var nsResolver = namespace ? function(prefix) { - if (prefix == 'x') return namespace; else return null; - } : null; - - if(doc.evaluate('//input[@id="articleListHeader_selectAllToc"]', doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext()) { - Zotero.debug("multiple"); - return "multiple"; - } else if (doc.evaluate('//div[@id="articleHead"]', doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext()) { - return "journalArticle"; - } - return false; -} - -function doWeb(doc, url){ - var namespace = doc.documentElement.namespaceURI; - var nsResolver = namespace ? function(prefix) { - if (prefix == 'x') return namespace; else return null; - } : null; - var host = 'http://' + doc.location.host + "/"; - Zotero.debug(host); - var m = url.match(/https?:\/\/[^\/]*\/doi\/(abs|full)\/([^\?]+)/); - var dois = new Array(); - if(detectWeb(doc, url) == "multiple") { //search - var doi; - var title; - var availableItems = new Array(); - var xpath = '//div[@class="articleBox" or @class="articleBox "]'; - if (doc.evaluate(xpath, doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext()) { - elmts = doc.evaluate(xpath, doc, nsResolver, XPathResult.ANY_TYPE, null); - var elmt = elmts.iterateNext(); - do { - title = doc.evaluate('./div[@class="articleBoxMeta"]/h2', elmt, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent; - doi = doc.evaluate('./div[@class="articleBoxMeta"]/h2/a/@href', elmt, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent.replace("/doi/abs/",""); - if (doi.indexOf("prevSearch") != -1){ - doi = doi.substring(0,doi.indexOf("?")); - } - availableItems[doi] = title; - } while (elmt = elmts.iterateNext()) - } - var items = Zotero.selectItems(availableItems); - if(!items) { - return true; - } - for(var i in items) { - dois.push(i); - } - } else if (m){ //single article - var doi = m[2]; - if (doi.match("prevSearch")) { - doi = doi.substring(0,doi.indexOf("?")); - } - Zotero.debug("DOI= "+doi); - dois.push(doi); - } - - var setupSets = []; - for each (doi in dois) { - var citUrl = host + 'action/showCitFormats?doi=' + doi; - setupSets.push({ doi: doi, citUrl: citUrl }); - } - - var setupCallback = function () { - //get citation export page's source code; - if (setupSets.length) { - var set = setupSets.shift(); - Zotero.Utilities.HTTP.doGet(set.citUrl, function(text){ - //get the exported RIS file name; - var downloadFileName = text.match(/name=\"downloadFileName\" value=\"([A-Za-z0-9_]+)\"/)[1]; - Zotero.debug("downloadfilename= "+downloadFileName); - processCallback(set.doi,downloadFileName); - }); - } - else { - Zotero.done(); - } - } - var processCallback = function (doi,downloadFileName) { - var baseurl = "http://pubs.acs.org/action/downloadCitation"; - var post = "doi=" + doi + "&downloadFileName=" + downloadFileName + "&include=abs&format=refman&direct=on&submit=Download+article+citation+data"; - Zotero.Utilities.HTTP.doPost(baseurl, post,function(text){ - // Fix the RIS doi mapping - text = text.replace("N1 - doi:","M3 - "); - Zotero.debug("ris= "+ text); - var translator = Zotero.loadTranslator("import"); - translator.setTranslator("32d59d2d-b65a-4da4-b0a3-bdd3cfb979e7"); - translator.setString(text); - translator.setHandler("itemDone", function(obj, item) { - var pdfUrl = host + 'doi/pdf/' + doi; - var fullTextUrl = host + 'doi/full/' + doi; - item.attachments.push( - {title:"ACS Full Text PDF",url:pdfUrl, mimeType:"application/pdf"}, - {title:"ACS Full Text Snapshot",url:fullTextUrl, mimeType:"text/html"} - ); - item.complete(); - }); - translator.translate(); - setupCallback(); - }); - } - setupCallback(); - Zotero.wait(); -} diff --git a/translators/AGU Journals.js b/translators/AGU Journals.js deleted file mode 100644 index b7c348e9d..000000000 --- a/translators/AGU Journals.js +++ /dev/null @@ -1,258 +0,0 @@ -{ - "translatorID":"9220fa99-b936-430e-a8ea-43ca6cb04145", - "translatorType":4, - "label":"AGU Journals", - "creator":"Ben Parr", - "target":"^https?://(?:www.)?agu.org", - "minVersion":"1.0.0b4.r1", - "maxVersion":"", - "priority":100, - "inRepository":true, - "lastUpdated":"2011-01-11 04:31:00" -} - -function detectWeb(doc,url) -{ - var namespace = doc.documentElement.namespaceURI; - var nsResolver = namespace ? function(prefix) { - if (prefix == 'x') return namespace; else return null; - } : null; - - var xpath; - - //abstract - xpath='//p[@id="citation"]'; - if(doc.evaluate(xpath, doc, nsResolver,XPathResult.ANY_TYPE,null).iterateNext()) - { return "journalArticle"; } - - //full text - xpath='//frameset[@rows="98, *"]'; - if(doc.evaluate(xpath, doc, nsResolver,XPathResult.ANY_TYPE,null).iterateNext()) - { return "journalArticle"; } - - //issue page - xpath='//tr/td/p[@class="title"]'; - if(doc.evaluate(xpath, doc, nsResolver,XPathResult.ANY_TYPE,null).iterateNext()) - { return "multiple"; } - - //Search Page - if(doc.title.indexOf("Query Results")>-1) - {return "multiple";} -} - - -function fixCaps(s) -{ - if(s!='') - { - words=Zotero.Utilities.trimInternal(s).toLowerCase().split(" "); - for (var j = 0 ; j < words.length ; j++) - { - if (j==0||(words[j][0] ==words[j][0].toLowerCase()&&words[j]!="or"&&words[j]!="and"&&words[j]!="of"&&words[j]!="in")) - { words[j]= words[j][0].toUpperCase() +words[j].substr(1); } - } - return words.join(" "); - } - return ''; -} - -function scrape(doc,url) -{ - var namespace = doc.documentElement.namespaceURI; - var nsResolver = namespace ? function(prefix) { - if (prefix == 'x') return namespace; else return null; - } : null; - - var newItem=new Zotero.Item("journalArticle"); - var temp; - var xpath; - var row; - var rows; - - newItem.url = doc.location.href; - - xpath='//p[@id="title"]'; - temp=doc.evaluate(xpath, doc, nsResolver,XPathResult.ANY_TYPE,null).iterateNext(); - if(temp) - {newItem.title=temp.textContent;} - - xpath='//span[@id="published"]'; - temp=doc.evaluate(xpath, doc, nsResolver,XPathResult.ANY_TYPE,null).iterateNext(); - if(temp) - { - temp=Zotero.Utilities.trimInternal(temp.textContent).split(" ");; - newItem.date=temp[1]+" "+temp[0]+", "+temp[2]; - } - - xpath='//p[@class="author"]'; - rows=doc.evaluate(xpath, doc, nsResolver,XPathResult.ANY_TYPE, null); - var count=0; - while(row=rows.iterateNext()) - {newItem.creators.push(Zotero.Utilities.cleanAuthor(row.textContent,"author")); - count++;} - - xpath='//tr/td/p'; - temp=doc.evaluate(xpath, doc, nsResolver,XPathResult.ANY_TYPE, null); - var temp2=temp.iterateNext(); - if(temp2) - { - for(var n=0;n<(3+2*count);n++) - {temp2=temp.iterateNext();} - newItem.abstractNote=Zotero.Utilities.trimInternal(temp2.textContent); - } - - xpath='//p[@id="runhead"]'; - temp=doc.evaluate(xpath, doc, nsResolver,XPathResult.ANY_TYPE,null).iterateNext(); - if(temp) - { - temp=Zotero.Utilities.trimInternal(temp.textContent).split(", "); - newItem.publicationTitle=fixCaps(temp[0]); - for(var n=1;temp[n];n++) - { - if(temp[n].indexOf("VOL")>-1) - {newItem.volume=temp[n].replace('VOL. ','');} - else if(temp[n].indexOf("NO.")>-1) - {newItem.issue=temp[n].replace('NO. ','');} - else if(temp[n].indexOf("doi:")>-1) - {newItem.DOI=temp[n].replace('doi:','');} - else if(temp[n+1]) - {newItem.pages=temp[n];} - } - } - - xpath='//p[@id="keywords"]'; - temp=doc.evaluate(xpath, doc, nsResolver,XPathResult.ANY_TYPE,null).iterateNext(); - if(temp) - { - temp=Zotero.Utilities.trimInternal(temp.textContent.replace('Keywords:','')); - newItem.tags=temp.replace('.','').split('; '); - } - xpath='//p[@id="citation"]/span[@id="journal"]'; - temp=doc.evaluate(xpath, doc, nsResolver,XPathResult.ANY_TYPE,null).iterateNext(); - if(temp) - {newItem.journalAbbreviation=temp.textContent;} - - newItem.complete(); -} - - -function processList(items) -{ - items = Zotero.selectItems(items); - var uris=new Array(); - - if (!items) - {return true;} - - for (var i in items) - {uris.push(i);} - - Zotero.Utilities.processDocuments(uris, scrape,function() {Zotero.done(); }); - Zotero.wait(); - - return true; -} - -function doWeb(doc,url) -{ - var namespace = doc.documentElement.namespaceURI; - var nsResolver = namespace ? function(prefix) { - if (prefix == 'x') return namespace; else return null; - } : null; - - //abstract - var xpath='//p[@id="citation"]'; - if(doc.evaluate(xpath, doc, nsResolver,XPathResult.ANY_TYPE,null).iterateNext()) - { - scrape(doc,url); - return true; - } - - //full text - xpath='//frameset[@rows="98, *"]'; - if(doc.evaluate(xpath, doc, nsResolver,XPathResult.ANY_TYPE,null).iterateNext()) - { - Zotero.Utilities.processDocuments(url+"0.shtml", scrape, function(){ Zotero.done(); }); - Zotero.wait(); - - return true; - } - - //issue page - xpath='//tr/td/p[@class="title"]'; - if(doc.evaluate(xpath, doc, nsResolver,XPathResult.ANY_TYPE,null).iterateNext()) - { - var titlerows=doc.evaluate(xpath, doc, nsResolver,XPathResult.ANY_TYPE, null); - xpath='//tr/td/p[@class="pubdate"]/a'; - var linkrows=doc.evaluate(xpath, doc, nsResolver,XPathResult.ANY_TYPE, null); - - var titlerow; - var linkrow; - var items=new Array(); - - while(titlerow=titlerows.iterateNext()) - { - linkrow=linkrows.iterateNext(); - while(linkrow.textContent.indexOf("Abstract")<0) - {linkrow=linkrows.iterateNext();} - items[linkrow.href]=titlerow.textContent; - } - - return processList(items); - } - - - //Search page - if(doc.title.indexOf("Query Results")>-1) - { - //FASTFind Search - - xpath='//tr/td/h2'; - var tt=doc.evaluate(xpath, doc, nsResolver,XPathResult.ANY_TYPE,null).iterateNext().textContent; - if(tt.indexOf("FASTFIND")>-1) - { - xpath='//tr/td[1]/font'; - var citerows=doc.evaluate(xpath, doc, nsResolver,XPathResult.ANY_TYPE, null); - xpath='//tr/td[2]/font/a'; - var linkrows=doc.evaluate(xpath, doc, nsResolver,XPathResult.ANY_TYPE, null); - - var citerow; - var linkrow; - var items=new Array(); - var temp; - var title; - - while(citerow=citerows.iterateNext()) - { - linkrow=linkrows.iterateNext(); - items[linkrow.href]=Zotero.Utilities.trimInternal(citerow.textContent); - } - return processList(items); - } - else - { - //Advanced Search - - xpath='//tr/td[1]/font/a'; - var titlerows=doc.evaluate(xpath, doc,nsResolver,XPathResult.ANY_TYPE, null); - xpath='//tr/td[2]/font/a'; - var linkrows=doc.evaluate(xpath, doc, nsResolver,XPathResult.ANY_TYPE, null); - - var titlerow; - var linkrow; - var items=new Array(); - var temp; - - while(titlerow=titlerows.iterateNext()) - { - linkrow=linkrows.iterateNext(); - while(linkrow.textContent.indexOf("Abstract")<0) - {linkrow=linkrows.iterateNext();} - - items[linkrow.href]=titlerow.textContent; - } - return processList(items); - } - } - -} diff --git a/translators/AJHG.js b/translators/AJHG.js deleted file mode 100644 index d02c9af41..000000000 --- a/translators/AJHG.js +++ /dev/null @@ -1,84 +0,0 @@ -{ - "translatorID":"0a01d85e-483c-4998-891b-24707728d83e", - "translatorType":4, - "label":"AJHG", - "creator":"Michael Berkowitz", - "target":"http://(www.)?ajhg.org/", - "minVersion":"1.0.0b4.r5", - "maxVersion":"", - "priority":100, - "inRepository":true, - "lastUpdated":"2008-02-14 23:15:00" -} - -function detectWeb(doc, url) { - if (doc.evaluate('//div[@class="article_links"]/a[1]', doc, null, XPathResult.ANY_TYPE, null).iterateNext()) { - return "multiple"; - } else if (url.indexOf("abstract") != -1 || url.indexOf("fulltext") != -1) { - return "journalArticle"; - } -} - -function getID(str) { - str = str.match(/\/([^/]+)$/)[1]; - if (str.indexOf("#") != -1) { - str = str.substr(0, str.length - 1); - } - return str; -} - -function doWeb(doc, url) { - var articles = new Array(); - if (detectWeb(doc, url) == "multiple") { - var items = new Object(); - if (doc.title.indexOf("Search Results") != -1) { - var xpath = '//table[@id="search_results"]/tbody/tr/td[1]'; - var titlex = './strong'; - var linkx = './div/a[1]'; - } else { - var xpath = '//div[@id="main_toc"]/dl'; - var titlex = './dt'; - var linkx = './dd/div/a[1]'; - } - var blocks = doc.evaluate(xpath, doc, null, XPathResult.ANY_TYPE, null); - var next_block; - while (next_block = blocks.iterateNext()) { - var title = doc.evaluate(titlex, next_block, null, XPathResult.ANY_TYPE, null).iterateNext().textContent; - var link = doc.evaluate(linkx, next_block, null, XPathResult.ANY_TYPE, null).iterateNext().href; - items[link] = title; - } - items = Zotero.selectItems(items); - for (var i in items) { - articles.push(getID(i)); - } - } else { - articles = [getID(url)]; - } - Zotero.debug(articles); - for (var i in articles) { - var poststr = 'format=cite-abs&citation-type=RIS&pii=' + articles[i] + '&action=download&Submit=Export'; - var pdfurl = 'http://download.ajhg.org/AJHG/pdf/PII' + articles[i].replace(/(\(|\)|\-)/g, "") + '.pdf'; - var newurl = 'http://www.ajhg.org/AJHG/fulltext/' + articles[i]; - Zotero.Utilities.HTTP.doPost('http://ajhg.org/AJHG/citationexport', poststr, function(text) { - var trans = Zotero.loadTranslator("import"); - trans.setTranslator("32d59d2d-b65a-4da4-b0a3-bdd3cfb979e7"); - trans.setString(text); - trans.setHandler("itemDone", function(obj, item) { - item.attachments = [ - {url:newurl, title:"AJHG Snapshot", mimeType:"text/html"}, - {url:pdfurl, title:"AJHG Full Text PDF", mimeType:"application/pdf"} - ]; - - if (item.notes[0]["note"]) { - item.abstractNote = item.notes[0]["note"]; - } - item.notes = []; - item.complete(); - }); - trans.translate(); - Zotero.done(); - }); - } - Zotero.wait(); - -} \ No newline at end of file diff --git a/translators/AMS Journals.js b/translators/AMS Journals.js deleted file mode 100644 index b494db716..000000000 --- a/translators/AMS Journals.js +++ /dev/null @@ -1,79 +0,0 @@ -{ - "translatorID":"bdaac15c-b0ee-453f-9f1d-f35d00c7a994", - "translatorType":4, - "label":"AMS Journals", - "creator":"Michael Berkowitz", - "target":"http://www.ams.org/", - "minVersion":"1.0.0b4.r5", - "maxVersion":"", - "priority":100, - "inRepository":true, - "lastUpdated":"2009-01-08 08:19:07" -} - -function detectWeb(doc, url) { - if (url.match(/jour(nals|search)/)) { - return "multiple"; - } else if (url.match(/\d{4}\-\d{2}\-\d{2}/)) { - return "journalArticle"; - } -} - -function doWeb(doc, url) { - var namespace = doc.documentElement.namespaceURI; - var nsResolver = namespace ? function(prefix) { - if (prefix == 'x') return namespace; else return null; - } : null; - var articles = new Array(); - if (detectWeb(doc, url) == "multiple") { - var items = new Object(); - if (url.match(/joursearch/)) { - var titlex = '//table/tbody/tr/td/span[@class="searchResultsArticleTitle"]'; - var linkx = '//table/tbody/tr[td/span[@class="searchResultsArticleTitle"]]//a[contains(text(), "Abstract")]'; - } else { - var titlex = '//div[@class="contentList"]/dl/dt[@class="articleTitleInAbstract"]'; - var linkx = '//div[@class="contentList"]/dl/dd/a[contains(text(), "Abstract")]' - } - var titles = doc.evaluate(titlex, doc, nsResolver, XPathResult.ANY_TYPE, null); - var links = doc.evaluate(linkx, doc, nsResolver, XPathResult.ANY_TYPE, null); - var title, link; - while ((title = titles.iterateNext()) && (link = links.iterateNext())) { - items[link.href] = Zotero.Utilities.trimInternal(title.textContent); - } - items = Zotero.selectItems(items); - for (var i in items) { - articles.push(decodeURIComponent(i)); - } - } else { - articles = [url]; - } - Zotero.debug(articles); - Zotero.Utilities.processDocuments(articles, function(doc) { - var item = new Zotero.Item("journalArticle"); - item.publicationTitle = doc.title; - item.ISSN = doc.evaluate('//span[@class="journalISSN"]', doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent.match(/\(e\)\s+ISSN:?\s+(.*)\(p\)/)[1]; - item.title = Zotero.Utilities.trimInternal(doc.evaluate('//p[@class="articleTitle"]', doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent); - var data = Zotero.Utilities.trimInternal(doc.evaluate('//p[span[@class="bibDataTag"]][1]', doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent); - data = data.replace(/(Journal|MSC|Posted|Retrieve)/g, "\n$1"); - Zotero.debug(data); - var authors = data.match(/Author\(s\):\s+(.*)\n/)[1].split(/;\s+/); - for each (var aut in authors) { - item.creators.push(Zotero.Utilities.cleanAuthor(aut, "author")); - } - var journalinfo = data.match(/Journal:\s+(.*)\n/)[1].match(/^([^\d]+)(\d+)\s+\((\d+)\),\s+(.*)$/); - item.journalAbbreviation = journalinfo[1]; - item.volume = journalinfo[2]; - item.pages = journalinfo[4]; - item.date = Zotero.Utilities.trimInternal(data.match(/Posted:\s+(.*)\n/)[1]); - item.url = doc.location.href; - item.issue = item.url.match(/(\d+)\/S/)[1]; - var pdfurl = item.url.replace(/([^/]+)\/home.html$/, "$1/$1.pdf"); - item.attachments = [ - {url:item.url, title:item.journalAbbreviation + " Snapshot", mimeType:"text/html"}, - {url:pdfurl, title:item.journalAbbreviation + " PDF", mimeType:"application/pdf"} - ]; - item.abstract = Zotero.Utilities.trimInternal(doc.evaluate('//td[@class="bottomCell"]/p[4]', doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent.substr(10)); - item.complete(); - }, function() {Zotero.done();}); - Zotero.wait(); -} \ No newline at end of file diff --git a/translators/AMS MathSciNet.js b/translators/AMS MathSciNet.js deleted file mode 100644 index 356f8018c..000000000 --- a/translators/AMS MathSciNet.js +++ /dev/null @@ -1,98 +0,0 @@ -{ - "translatorID":"a354331-981b-43de-a61-bc26dd1be3a9", - "label":"AMS MathSciNet", - "creator":"Simon Kornblith", - "target":"^https?://www\\.ams\\.org[^/]*/mathscinet/search/(?:publications\\.html|publdoc\\.html)", - "minVersion":"1.0.0b3.r1", - "maxVersion":"", - "priority":100, - "inRepository":"1", - "translatorType":4, - "lastUpdated":"2010-06-06 19:00:50" -} - -function detectWeb(doc, url) { - var namespace = doc.documentElement.namespaceURI; - var nsResolver = namespace ? function(prefix) { - if (prefix == 'x') return namespace; else return null; - } : null; - - var tableRows = doc.evaluate('//div[@id="content"]/form/div[@class="headline"]', doc, nsResolver, - XPathResult.ANY_TYPE, null); - if(tableRows.iterateNext()) { - return "multiple" - } else if(doc.evaluate('//div[@id="titleSeparator"]/div[@class="navbar"]/span[@class="PageLink"]/a[text() = "Up"]', - doc, nsResolver, XPathResult.ANY_TYPE, null)) { - return "journalArticle"; - } - - return false; -} - -function doWeb(doc, url) { - var namespace = doc.documentElement.namespaceURI; - var nsResolver = namespace ? function(prefix) { - if (prefix == 'x') return namespace; else return null; - } : null; - - var pub = "http://www.ams.org/mathscinet/search/publications.html?fmt=bibtex"; - - var tableRows = doc.evaluate('//div[@id="content"]/form/div[@class="headline"]', doc, nsResolver, - XPathResult.ANY_TYPE, null); - var tableRow = tableRows.iterateNext(); - if(tableRow) { - // search page - var items = new Object(); - var links = new Object(); - - do { - var id = doc.evaluate('.//input[@type="checkbox"]', tableRow, nsResolver, - XPathResult.ANY_TYPE, null).iterateNext().value; - items[id] = doc.evaluate('./div[@class="headlineText"]/span[@class="title"]', tableRow, nsResolver, - XPathResult.ANY_TYPE, null).iterateNext().textContent; - links[id] = doc.evaluate('.//a', tableRow, nsResolver, XPathResult.ANY_TYPE, - null).iterateNext().href; - } while(tableRow = tableRows.iterateNext()) - - - items = Zotero.selectItems(items); - if(!items) return true; - - var docLinks = new Array(); - for(var id in items) { - pub += "&b="+id; - docLinks.push(links[id]); - } - } else { - var MR = doc.evaluate('//div[@id="content"]/div[@class="doc"]/div[@class="headline"]/strong', - doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent; - pub += "&b="+MR.replace(/^MR0*/, ""); - } - - Zotero.Utilities.HTTP.doGet(pub, function(text) { - var m = text.match(/
(?:.|[\r\n])*?<\/pre>/g);
-		var bibTeXString = "";
-		for each(var citation in m) {
-			// kill pre tags
-			citation = citation.substring(5, citation.length-6);
-			bibTeXString += citation;
-		}
-		
-		// import using BibTeX
-		var translator = Zotero.loadTranslator("import");
-		translator.setTranslator("9cb70025-a888-4a29-a210-93ec52da40d4");
-		translator.setString(bibTeXString);
-		translator.setHandler("itemDone", function(obj, item) {
-			if(docLinks) {
-				item.attachments.push({title:"MathSciNet Snapshot", url:docLinks.shift(), mimeType:"text/html"});
-			} else {
-				item.attachments.push({title:"MathSciNet Snapshot", document:doc});
-			}
-			
-			item.complete();
-		});
-		translator.translate();
-		
-		Zotero.done();
-	});
-}
diff --git a/translators/APA PsycNET.js b/translators/APA PsycNET.js
deleted file mode 100644
index 14b50cdc0..000000000
--- a/translators/APA PsycNET.js	
+++ /dev/null
@@ -1,146 +0,0 @@
-{
-	"translatorID": "1e1e35be-6264-45a0-ad2e-7212040eb984",
-	"label": "APA PsycNET",
-	"creator": "Michael Berkowitz",
-	"target": "^http://psycnet\\.apa\\.org/",
-	"minVersion": "2.1",
-	"maxVersion": "",
-	"priority": 100,
-	"browserSupport": "gcs",
-	"inRepository": true,
-	"translatorType": 4,
-	"lastUpdated": "2011-08-22 22:43:11"
-}
-
-function detectWeb(doc, url) {
-	if (url.match(/search\.searchResults/)) {
-		return false;
-		//return "multiple";
-	} else if (url.match(/search\.displayRecord/)) {
-		return "journalArticle";
-	}
-}
-
-function associateXPath(xpath, doc, ns) {
-	return Zotero.Utilities.trimInternal(doc.evaluate(xpath, doc, ns, XPathResult.ANY_TYPE, null).iterateNext().textContent);
-}
-
-function doWeb(doc, url) {
-		var namespace = doc.documentElement.namespaceURI;
-		var nsResolver = namespace ? function(prefix) {
-			if (prefix == 'x') return namespace; else return null;
-		} : null;
-		var arts = new Array();
-	if (detectWeb(doc, url) == "multiple") {
-		var items = new Object();
-		var titles = doc.evaluate('//div[@class="srhcTitle"]/a', doc, nsResolver, XPathResult.ANY_TYPE, null);
-		var title;
-		while (title = titles.iterateNext()) {
-			items[title.href] = title.textContent;
-		}
-		items = Zotero.selectItems(items);
-		for (var i in items) {
-			arts.push(i);
-		}
-		Zotero.Utilities.processDocuments(arts, scrape, function() {Zotero.done();});
-	} else {
-		scrape(doc);
-	}
-	Zotero.wait();
-}
-
-function scrape (doc) {
-		var namespace = null;
-		var newurl = doc.location.href;
-		if (doc.evaluate('//input[@name="id"]', doc, null, XPathResult.ANY_TYPE, null).iterateNext()) {
-			var id = doc.evaluate('//input[@name="id"]', doc, null, XPathResult.ANY_TYPE, null).iterateNext().value;
-			var lstSelectedUIDs = doc.evaluate('//input[@name="lstUIDs"][@id="srhLstUIDs"]', doc, null, XPathResult.ANY_TYPE, null).iterateNext().value;
-			var get = 'http://psycnet.apa.org/index.cfm?fa=search.export'
-			var post = 'id=' + id + '&lstUIDs=' + lstSelectedUIDs + '&lstSelectedUIDs=&records=records&displayFormat=&exportFormat=referenceSoftware&printDoc=0';
-			// http://psycnet.apa.org/index.cfm?fa=search.exportFormat&singlerecord=1
-			// id=&lstSelectedUIDs=&lstUIDs=2004-16644-010&records=records&displayFormat=&exportFormat=referenceSoftware&printDoc=0
-			Zotero.Utilities.HTTP.doPost(get, post, function(text) {
-				// http://psycnet.apa.org/index.cfm?fa=search.export
-				var translator = Zotero.loadTranslator("import");
-				translator.setTranslator("32d59d2d-b65a-4da4-b0a3-bdd3cfb979e7");
-				translator.setString(text);
-				//Z.debug(text);
-				translator.setHandler("itemDone", function(obj, item) {
-					//item.url = newurl;
-					//item.attachments = [{url:newurl, title:"APA PsycNET Snapshot", mimeType:"text/html"}];
-					item.complete();
-				});
-				translator.translate();
-			});
-		} else {
-			var item = new Zotero.Item("journalArticle");
-			item.title = associateXPath('//div[@id="rdcTitle"]', doc, nsResolver);
-			var authors = associateXPath('//div[@id="rdcAuthors"]', doc, nsResolver).split(/;\s+/);
-			for each (var aut in authors) {
-				item.creators.push(Zotero.Utilities.cleanAuthor(aut, "author", true));
-			}
-			var voliss = associateXPath('//div[@id="rdcSource"]', doc, nsResolver).match(/^([^\.]+)\.\s+(\d+\s+\w+)\s+Vol\s+(\d+)\((\d+)\)\s+(.*)$/);
-			item.publicationTitle = voliss[1];
-			item.date = voliss[2];
-			item.volume = voliss[3];
-			item.issue = voliss[4];
-			item.pages = voliss[5];
-			item.abstractNote = associateXPath('//div[@id="rdRecord"]/div[@class="rdRecordSection"][2]', doc, nsResolver);
-			item.complete();			
-		}
-	}/** BEGIN TEST CASES **/
-var testCases = [
-	{
-		"type": "web",
-		"url": "http://psycnet.apa.org/index.cfm?fa=search.displayRecord&uid=2004-16644-010",
-		"items": [
-			{
-				"itemType": "journalArticle",
-				"creators": [
-					{
-						"lastName": "Hervey",
-						"firstName": "Aaron S.",
-						"creatorType": "author"
-					},
-					{
-						"lastName": "Epstein",
-						"firstName": "Jeffery N.",
-						"creatorType": "author"
-					},
-					{
-						"lastName": "Curry",
-						"firstName": "John F.",
-						"creatorType": "author"
-					}
-				],
-				"notes": [],
-				"tags": [
-					"attention-deficit/hyperactivity disorder",
-					"adults",
-					"behavioral inhibition",
-					"neuropsychological performance",
-					"developmental considerations",
-					"neuropsychological deficits",
-					"empirical methods"
-				],
-				"seeAlso": [],
-				"attachments": [],
-				"itemID": "2004-16644-010",
-				"title": "Neuropsychology of Adults With Attention-Deficit/Hyperactivity Disorder: A Meta-Analytic Review.",
-				"publicationTitle": "Neuropsychology",
-				"volume": "18",
-				"issue": "3",
-				"pages": "485-503",
-				"date": "2004",
-				"publisher": "US: American Psychological Association",
-				"ISBN": "1931-1559 (Electronic); 0894-4105 (Print)",
-				"ISSN": "1931-1559 (Electronic); 0894-4105 (Print)",
-				"abstractNote": "A comprehensive, empirically based review of the published studies addressing neuropsychological performance in adults diagnosed with attention-deficit/hyperactivity disorder (ADHD) was conducted to identify patterns of performance deficits. Findings from 33 published studies were submitted to a meta-analytic procedure producing sample-size-weighted mean effect sizes across test measures. Results suggest that neuropsychological deficits are expressed in adults with ADHD across multiple domains of functioning, with notable impairments in attention, behavioral inhibition, and memory, whereas normal performance is noted in simple reaction time. Theoretical and developmental considerations are discussed, including the role of behavioral inhibition and working memory impairment. Future directions for research based on these findings are highlighted, including further exploration of specific impairments and an emphasis on particular tests and testing conditions. (PsycINFO Database Record (c) 2010 APA, all rights reserved)",
-				"DOI": "10.1037/0894-4105.18.3.485",
-				"libraryCatalog": "APA PsycNET",
-				"shortTitle": "Neuropsychology of Adults With Attention-Deficit/Hyperactivity Disorder"
-			}
-		]
-	}
-]
-/** END TEST CASES **/
diff --git a/translators/APN.ru.js b/translators/APN.ru.js
deleted file mode 100644
index 108b22329..000000000
--- a/translators/APN.ru.js
+++ /dev/null
@@ -1,59 +0,0 @@
-{
-        "translatorID": "737216af-fc48-4aa5-bfae-560c9cfc5df5",
-        "label": "Агенство политических новостей",
-        "creator": "Avram Lyon",
-        "target": "^https?:\\/\\/www\\.apn\\.ru\\/",
-        "minVersion": "2.0",
-        "maxVersion": "",
-        "priority": 100,
-        "inRepository": true,
-        "translatorType": 4,
-        "lastUpdated": "2011-05-24 00:34:40"
-}
-
-/* FW LINE 46:127318f30c1d */ function flatten(c){var b=new Array();for(var d in c){var e=c[d];if(e instanceof Array){b=b.concat(flatten(e))}else{b.push(e)}}return b}var FW={_scrapers:new Array()};FW._Base=function(){this.callHook=function(b,c,e,a){if(typeof this["hooks"]==="object"){var d=this["hooks"][b];if(typeof d==="function"){d(c,e,a)}}};this.evaluateThing=function(f,e,c){var b=typeof f;if(b==="string"){return f}else{if(b==="object"){if(f instanceof Array){var d=this.evaluateThing;var a=f.map(function(g){return d(g,e,c)});return flatten(a)}else{return f.evaluate(e,c)}}else{if(b==="function"){return f(e,c)}else{return undefined}}}}};FW.Scraper=function(a){FW._scrapers.push(new FW._Scraper(a))};FW._Scraper=function(a){for(x in a){this[x]=a[x]}this._singleFieldNames=["abstractNote","applicationNumber","archive","archiveLocation","artworkMedium","artworkSize","assignee","audioFileType","audioRecordingType","billNumber","blogTitle","bookTitle","callNumber","caseName","code","codeNumber","codePages","codeVolume","committee","company","conferenceName","country","court","date","dateDecided","dateEnacted","dictionaryTitle","distributor","docketNumber","documentNumber","DOI","edition","encyclopediaTitle","episodeNumber","extra","filingDate","firstPage","forumTitle","genre","history","institution","interviewMedium","ISBN","ISSN","issue","issueDate","issuingAuthority","journalAbbreviation","label","language","legalStatus","legislativeBody","letterType","libraryCatalog","manuscriptType","mapType","medium","meetingName","nameOfAct","network","number","numberOfVolumes","numPages","pages","patentNumber","place","postType","presentationType","priorityNumbers","proceedingsTitle","programTitle","programmingLanguage","publicLawNumber","publicationTitle","publisher","references","reportNumber","reportType","reporter","reporterVolume","rights","runningTime","scale","section","series","seriesNumber","seriesText","seriesTitle","session","shortTitle","studio","subject","system","thesisType","title","type","university","url","version","videoRecordingType","volume","websiteTitle","websiteType"];this._makeAttachments=function(q,b,f,s){if(f instanceof Array){f.forEach(function(k){this._makeAttachments(q,b,k,s)},this)}else{if(typeof f==="object"){var p=f.urls||f.url;var m=f.types||f.type;var e=f.titles||f.title;var h=this.evaluateThing(p,q,b);var o=this.evaluateThing(e,q,b);var r=this.evaluateThing(m,q,b);var l=(r instanceof Array);var n=(o instanceof Array);if(!(h instanceof Array)){h=[h]}for(var j in h){var c=h[j];var g;var d;if(l){g=r[j]}else{g=r}if(n){d=o[j]}else{d=o}s.attachments.push({url:c,title:d,type:g})}}}};this.makeItems=function(o,b,m,c,l){var q=new Zotero.Item(this.itemType);q.url=b;for(var h in this._singleFieldNames){var n=this._singleFieldNames[h];if(this[n]){var g=this.evaluateThing(this[n],o,b);if(g instanceof Array){q[n]=g[0]}else{q[n]=g}}}var r=["creators","tags"];for(var f in r){var p=r[f];var d=this.evaluateThing(this[p],o,b);if(d){for(var e in d){q[p].push(d[e])}}}this._makeAttachments(o,b,this["attachments"],q);c(q,this,o,b);l([q])}};FW._Scraper.prototype=new FW._Base;FW.MultiScraper=function(a){FW._scrapers.push(new FW._MultiScraper(a))};FW._MultiScraper=function(a){for(x in a){this[x]=a[x]}this._mkSelectItems=function(e,d){var b=new Object;for(var c in e){b[d[c]]=e[c]}return b};this._selectItems=function(d,c,e){var b=new Array();Zotero.selectItems(this._mkSelectItems(d,c),function(f){for(var g in f){b.push(g)}e(b)})};this._mkAttachments=function(g,d,f){var b=this.evaluateThing(this["attachments"],g,d);var c=new Object();if(b){for(var e in f){c[f[e]]=b[e]}}return c};this._makeChoices=function(f,p,c,d,h){if(f instanceof Array){f.forEach(function(k){this._makeTitlesUrls(k,p,c,d,h)},this)}else{if(typeof f==="object"){var m=f.urls||f.url;var e=f.titles||f.title;var n=this.evaluateThing(m,p,c);var j=this.evaluateThing(e,p,c);var l=(j instanceof Array);if(!(n instanceof Array)){n=[n]}for(var g in n){var b=n[g];var o;if(l){o=j[g]}else{o=j}h.push(b);d.push(o)}}}};this.makeItems=function(j,b,g,c,f){Zotero.debug("Entering MultiScraper.makeItems");if(this.beforeFilter){var k=this.beforeFilter(j,b);if(k!=b){this.makeItems(j,k,g,c,f);return}}var e=[];var h=[];this._makeChoices(this["choices"],j,b,e,h);var d=this._mkAttachments(j,b,h);this._selectItems(e,h,function(m){if(!m){f([])}else{var l=[];var n=this.itemTrans;Zotero.Utilities.processDocuments(m,function(q){var p=q.documentURI;var o=n;if(o===undefined){o=FW.getScraper(q,p)}if(o===undefined){}else{o.makeItems(q,p,d[p],function(r){l.push(r);c(r,o,q,p)},function(){})}},function(){f(l)})}})}};FW._MultiScraper.prototype=new FW._Base;FW.DelegateTranslator=function(a){return new FW._DelegateTranslator(a)};FW._DelegateTranslator=function(a){for(x in a){this[x]=a[x]}this._translator=Zotero.loadTranslator(this.translatorType);this._translator.setTranslator(this.translatorId);this.makeItems=function(g,d,b,f,c){Zotero.debug("Entering DelegateTranslator.makeItems");var e;Zotero.Utilities.HTTP.doGet(d,function(h){this._translator.setHandler("itemDone",function(k,j){e=j;if(b){j.attachments=b}});this._translator.setString(h);this._translator.translate();f(e)},function(){c([e])})}};FW.DelegateTranslator.prototype=new FW._Scraper;FW._StringMagic=function(){this._filters=new Array();this.addFilter=function(a){this._filters.push(a);return this};this.split=function(a){return this.addFilter(function(b){return b.split(a).filter(function(c){return(c!="")})})};this.replace=function(c,b,a){return this.addFilter(function(d){if(d.match(c)){return d.replace(c,b,a)}else{return d}})};this.prepend=function(a){return this.replace(/^/,a)};this.append=function(a){return this.replace(/$/,a)};this.remove=function(b,a){return this.replace(b,"",a)};this.trim=function(){return this.addFilter(function(a){return Zotero.Utilities.trim(a)})};this.trimInternal=function(){return this.addFilter(function(a){return Zotero.Utilities.trimInternal(a)})};this.match=function(a,b){if(!b){b=0}return this.addFilter(function(d){var c=d.match(a);if(c===undefined||c===null){return undefined}else{return c[b]}})};this.cleanAuthor=function(b,a){return this.addFilter(function(c){return Zotero.Utilities.cleanAuthor(c,b,a)})};this.key=function(a){return this.addFilter(function(b){return b[a]})};this.capitalizeTitle=function(){return this.addFilter(function(a){return Zotero.Utilities.capitalizeTitle(a)})};this.unescapeHTML=function(){return this.addFilter(function(a){return Zotero.Utilities.unescapeHTML(a)})};this.unescape=function(){return this.addFilter(function(a){return unescape(a)})};this._applyFilters=function(c,e){for(i in this._filters){c=flatten(c);c=c.filter(function(a){return((a!==undefined)&&(a!==null))});for(var d=0;d0&&a[0]){return f}}}return undefined};FW.getScraper=function(b,a){var c=FW.detectWeb(b,a);return FW._scrapers.filter(function(d){return(d.evaluateThing(d.itemType,b,a)==c)&&(d.evaluateThing(d.detect,b,a))})[0]};FW.doWeb=function(c,a){Zotero.debug("Entering FW.doWeb");var b=FW.getScraper(c,a);b.makeItems(c,a,[],function(f,e,g,d){e.callHook("scraperDone",f,g,d);if(!f.title){f.title=""}f.complete()},function(){Zotero.done()});Zotero.wait();Zotero.debug("Leaving FW.doWeb")};/*
-   APN.ru (Агенство политических новостей) Translator
-   Copyright (C) 2011 Avram Lyon, ajlyon@gmail.com
-
-   This program is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation, either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see .
- */
-
-function detectWeb(doc, url) { 
-		return FW.detectWeb(doc, url);
-}
-function doWeb(doc, url) { return FW.doWeb(doc, url); }
-
-
-/** Articles */
-FW.Scraper({ itemType         : 'newspaperArticle',
-             detect           : FW.Xpath('//div[@class="block_div"]/div/*[@class="article_title"]'),
-             title            : FW.Xpath('//div[@class="block_div"]/div/*[@class="article_title"]').text().trim(),
-             attachments      : [ {
-	             	url : FW.Url().replace(/article/,"print"),
-	             	type: "text/html",
-	             	title: "APN.ru Printable" }],
-             creators         : FW.Xpath('//div[@class="block_div"]/div/a[@class="pub_aname"]').text().cleanAuthor("author"),
-             date 	      : FW.Xpath('//div[@class="block_div"]/div/span[@class="pub_date"]').text(),
-             publicationTitle : "Агенство политических новостей" 
-  });
-
-
-/** Search results */
-FW.MultiScraper({ itemType  : "multiple",
-             	  detect    : FW.Xpath('//div[@class="search_content"]'),
-             	  choices : {
-	             	titles    : FW.Xpath('//div[@class="search_content"]/div/a[@class="searchtitle"]').text(),
-             	  	urls    : FW.Xpath('//div[@class="search_content"]/div/a[@class="searchtitle"]').key('href').text()
-             	  }
-});
diff --git a/translators/APS.js b/translators/APS.js
deleted file mode 100644
index cda1d1d2e..000000000
--- a/translators/APS.js
+++ /dev/null
@@ -1,65 +0,0 @@
-{
-	"translatorID":"2c310a37-a4dd-48d2-82c9-bd29c53c1c76",
-	"translatorType":4,
-	"label":"APS",
-	"creator":"Eugeniy Mikhailov and Michael Berkowitz",
-	"target":"https?://(?:www\\.)?(prola|prl|pra|prb|prc|prd|pre|prst-ab|prst-per|rmp)\\.aps\\.org[^/]*/(toc|abstract|forward|showrefs|supplemental)/",
-	"minVersion":"1.0.0b3.r1",
-	"maxVersion":null,
-	"priority":100,
-	"inRepository":true,
-	"lastUpdated":"2011-01-11 04:31:00"
-}
-// Works for all APS journals: http://publish.aps.org/
-
-function detectWeb(doc, url) {
-	// toc indicates table of contents, forward is a "Citing articles" page
-	if (/\/toc\//.test(url) || (/\/forward\//.test(url))){
-		return "multiple";
-	} else {
-		return "journalArticle";
-	}
-}
-
-function doWeb(doc, url) {
-    	var arts = new Array();
-    	if (detectWeb(doc, url) == "multiple") {
-	    	var items = Zotero.Utilities.getItemArray(doc, doc, "abstract");
-	    	items = Zotero.selectItems(items);
-	    	for (var i in items) {
-		    	arts.push(i);
-	    	}
-    	} else {
-	    	arts = [url];
-    	}
-    	
-    	Zotero.Utilities.processDocuments(arts, function(newDoc) {
-    		Zotero.debug(newDoc.title);
-		// Use abstract only if we have one
-		if (newDoc.evaluate('//div[contains(@class, "aps-abstractbox")]/p', newDoc, null, XPathResult.ANY_TYPE, null).iterateNext()) var abs = Zotero.Utilities.trimInternal(newDoc.evaluate('//div[contains(@class, "aps-abstractbox")]/p', newDoc, null, XPathResult.ANY_TYPE, null).iterateNext().textContent);
-    		var urlRIS = newDoc.location.href;
-		urlRIS = urlRIS.replace(/(abstract|forward|showrefs|supplemental)/,"export");
-		var post = "type=ris";
-		var snapurl = newDoc.location.href;
-		var pdfurl = snapurl.replace(/(abstract|forward|showrefs|supplemental)/, "pdf");
-		Zotero.Utilities.HTTP.doPost(urlRIS, post, function(text) {
-			// load translator for RIS
-			var translator = Zotero.loadTranslator("import");
-			translator.setTranslator("32d59d2d-b65a-4da4-b0a3-bdd3cfb979e7");
-			translator.setString(text);
-			translator.setHandler("itemDone", function(obj, item) {
-				if (item.itemID) {
-					item.DOI = item.itemID;
-				}
-				item.attachments = [
-					{url:snapurl, title:"APS Snapshot", mimeType:"text/html"},
-					{url:pdfurl, title:"APS Full Text PDF", mimeType:"application/pdf"}
-				];
-				if (abs) item.abstractNote = abs;
-				item.complete();
-			});
-			translator.translate();
-		 }, null, 'UTF-8');
-	}, function() {Zotero.done();});
-	Zotero.wait();
-}
\ No newline at end of file
diff --git a/translators/ARTFL Encyclopedie.js b/translators/ARTFL Encyclopedie.js
deleted file mode 100644
index 6d8860932..000000000
--- a/translators/ARTFL Encyclopedie.js	
+++ /dev/null
@@ -1,169 +0,0 @@
-{
-	"translatorID":"72cb2536-3211-41e0-ae8b-974c0385e085",
-	"translatorType":4,
-	"label":"ARTFL Encyclopedie",
-	"creator":"Sean Takats",
-	"target":"/cgi-bin/philologic31/(getobject\\.pl\\?c\\.[0-9]+:[0-9]+\\.encyclopedie|search3t\\?dbname=encyclopedie0507)",
-	"minVersion":"1.0.0b4.r1",
-	"maxVersion":"",
-	"priority":100,
-	"inRepository":true,
-	"lastUpdated":"2011-01-11 04:31:00"
-}
-
-function detectWeb(doc, url) {
-	if (url.indexOf("getobject.pl") != -1){
-		return "encyclopediaArticle";
-	} else {
-		return "multiple";
-	}
-}
-
-function reconcileAuthor(author){
-	var authorMap = {
-		"Venel":"Venel, Gabriel-François",
-		"d'Aumont":"d'Aumont, Arnulphe",
-		"de La Chapelle":"de La Chapelle, Jean-Baptiste",
-		"Bourgelat":"Bourgelat, Claude",
-		"Dumarsais":"Du Marsais, César Chesneau",
-		"Mallet":"Mallet, Edme-François",
-		"Toussaint":"Toussaint, François-Vincent",
-		"Daubenton":"Daubenton, Louis-Jean-Marie",
-		"d'Argenville": "d'Argenville, Antoine-Joseph Desallier",
-		"Tarin":"Tarin, Pierre",
-		"Vandenesse":"de Vandenesse, Urbain",
-		"Blondel": "Blondel, Jacques-François",
-		"Le Blond":"Le Blond, Guillaume",
-		"Rousseau":"Rousseau, Jean-Jacques",
-		"Eidous":"Eidous, Marc-Antoine",
-		"d'Alembert":"d'Alembert, Jean le Rond",
-		"Louis":"Louis, Antoine",
-		"Bellin":"Bellin, Jacques-Nicolas",
-		"Diderot":"Diderot, Denis",
-		"Diderot1":"Diderot, Denis",
-		"Diderot2":"Diderot, Denis",
-		"de Jaucourt":"de Jaucourt, Chevalier Louis",
-		"Jaucourt":"de Jaucourt, Chevalier Louis",
-		"d'Holbach":"d'Holbach, Baron"
-		/* not yet mapped
-		Yvon
-		Forbonnais
-		Douchet and Beauzée
-		Boucher d'Argis
-		Lenglet Du Fresnoy
-		Cahusac
-		Pestré
-		Daubenton, le Subdélégué
-		Goussier
-		de Villiers
-		Barthès
-		Morellet
-		Malouin
-		Ménuret de Chambaud
-		Landois
-		Le Roy
-		*/
-	}
-	if(authorMap[author]) {
-		author = authorMap[author];
-	}
-	// remove ARTFL's trailing 5 for odd contributors (e.g. Turgot5)
-		if (author.substr(author.length-1, 1)=="5"){
-		author = author.substr(0, author.length-1);
-	}
-	return author;
-}
-
-function scrape (doc){
-	var namespace = doc.documentElement.namespaceURI;
-	var nsResolver = namespace ? function(prefix) {
-		if (prefix == 'x') return namespace; else return null;
-		} : null;
-		var url = doc.location.href;
-		var newItem = new Zotero.Item("encyclopediaArticle");
-		var xpath = '/html/body/div[@class="text"]/font';
-		var titleElmt = doc.evaluate(xpath, doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext();
-		if (titleElmt) {
-			var title = titleElmt.textContent;
-		} else {
-			xpath = '/html/body/div[@class="text"]/b';
-			var title = doc.evaluate(xpath, doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent;
-		}
-		newItem.title = title;
-		newItem.encyclopediaTitle = "Encyclopédie, ou Dictionnaire raisonné des sciences, des arts et des métiers";
-		newItem.shortTitle = "Encyclopédie";
-		newItem.date = "1751-1772";
-		newItem.publisher = "Briasson";
-		newItem.place = "Paris";
-		newItem.url = url;
-	
-		newItem.attachments.push({title:"ARTFL Snapshot", mimeType:"text/html", url:url, snapshot:true});
-	
-		// get author and tags
-		var hostRegexp = new RegExp("^(https?://[^/]+)/");
-		var hMatch = hostRegexp.exec(url);
-		var host = hMatch[1];
-		var getString1 = "/cgi-bin/philologic31/search3t?dbname=encyclopedie0507&word=&dgdivhead=";
-		var getString2 = "&dgdivocauthor=&dgdivocplacename=&dgdivocsalutation=&dgdivocclassification=&dgdivocpartofspeech=&dgdivtype=&CONJUNCT=PHRASE&DISTANCE=3&PROXY=or+fewer&OUTPUT=conc&POLESPAN=5&KWSS=1&KWSSPRLIM=500";
-		
-		Zotero.Utilities.HTTP.doGet(host+getString1+title+getString2, function(text){
-			var tagRe = new RegExp('>'+title+'[^\[]*\\[([^\\]]*)\]', 'i');
-			var m = tagRe.exec(text);
-			if(m[1] != "unclassified"){
-			 	var tagstring = m[1].replace("&", "&", "g");
-				var tags = tagstring.split(";")
-				for(var j in tags) {
-					newItem.tags.push(Zotero.Utilities.trimInternal(tags[j]));
-				}
-			}
-			var authorRe = new RegExp('>'+title+',([^,]*),', "i");
-			var m = authorRe.exec(text);
-			var author = m[1];
-			author = Zotero.Utilities.trimInternal(author);
-			// reconcile author
-			author = reconcileAuthor(author);	
-			if (author!="NA"){ // ignore unknown authors
-				newItem.creators.push(Zotero.Utilities.cleanAuthor(author, "author", true));
-			}
-			newItem.creators.push({firstName:"Denis", lastName:"Diderot", creatorType:"editor"});
-			newItem.creators.push({firstName:"Jean le Rond", lastName:"d'Alembert", creatorType:"editor"});
-			newItem.complete();
-		}, function() {Zotero.done();}, null);
-		Zotero.wait();	
-}
-
-function doWeb(doc, url) {
-	var namespace = doc.documentElement.namespaceURI;
-	var nsResolver = namespace ? function(prefix) {
-		if (prefix == 'x') return namespace; else return null;
-		} : null;
-
-	if (url.indexOf("getobject.pl") != -1){
-		// single article
-		scrape(doc);				
-	} else {
-		//search page
-		var items = new Object();
-		var xpath = '/html/body/div[@class="text"]/p/a';
-		var elmts = doc.evaluate(xpath, doc, nsResolver, XPathResult.ANY_TYPE, null);
-		var elmt;		
-		while (elmt = elmts.iterateNext()){
-			var title = elmt.textContent;
-			var link = elmt.href;
-			if (title && link){
-				items[link] = title;
-			}			
-		}
-		var items = Zotero.selectItems(items);
-		if(!items) {
-			return true;
-		}
-		var urls = new Array();
-		for(var i in items) {
-			urls.push(i);
-		}
-		Zotero.Utilities.processDocuments(urls, scrape, function() { Zotero.done(); });
-		Zotero.wait();	
-	}
-		
-}
\ No newline at end of file
diff --git a/translators/ARTstor.js b/translators/ARTstor.js
deleted file mode 100644
index 0af9de96c..000000000
--- a/translators/ARTstor.js
+++ /dev/null
@@ -1,274 +0,0 @@
-{
-	"translatorID":"5278b20c-7c2c-4599-a785-12198ea648bf",
-	"translatorType":4,
-	"label":"ARTstor",
-	"creator":"Ameer Ahmed and Michael Berkowitz",
-	"target":"http://[^/]artstor.org[^/]*",
-	"minVersion":"1.0.0b4.r5",
-	"maxVersion":"",
-	"priority":100,
-	"inRepository":true,
-	"lastUpdated":"2009-11-13 07:10:00"
-}
-
-function detectWeb(doc, url) {
-	if (url.match(/(S|s)earch/) && (doc.evaluate('//div[@id="thumbContentWrap"]/div', doc, null, XPathResult.ANY_TYPE, null).iterateNext().textContent.match(/\w+/))) return "multiple"
-}
-
-function doWeb(doc, url) {
-	if (url.indexOf("|")!=-1){	
-	scrape(doc, url);
-	}
-}
-
-// TODO: Remove this when we drop support for Fx3
-if (!JSON) {
-	var JSON = new function() {
-		this.parse = function (arg) {
-			var j;
-			if (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/.test(arg.
-					replace(/\\./g, '@').
-					replace(/"[^"\\\n\r]*"/g, ''))) {
-				// Friendly AMO reviewer: This is the official json.org library and is safe.
-				j = eval('(' + arg + ')');
-				return j;
-			}
-			throw new SyntaxError('parseJSON');
-		}
-	}
-}
-
-function scrape(doc, url){
-	var savedItems = new Array();
-	var saved = 0;
-	var urlstub = url.substring(url.indexOf('.org/')+5,url.length);
-	urlstub = url.substring(0,url.indexOf('.org/')+5) + urlstub.substring(0, urlstub.indexOf('/')+1)
-	var suburl = url.substring(url.indexOf('|')+1, url.length);
-        var groupname = suburl.substring(0, suburl.indexOf("|"));
-	var searchterm = '//*[@id="thumbSubTitle"]';
-		var stt = doc.evaluate(searchterm, doc, null, XPathResult.ANY_TYPE, null).iterateNext();
-	var st = stt.firstChild.nodeValue;
-	var pageNn = '//*[@id="pageNo"]';
-	var stt = doc.evaluate(pageNn, doc, null, XPathResult.ANY_TYPE, null).iterateNext();
-	var pg;
-      	if (stt.value==1){
-        	pg = 1;
-        } else if (stt.value==2){
-        	pg = 25;
-        } else {
-		pg = ((stt.value-1) * 24) + 1;
-        }
-        var groupid;
-	//check if user is on search page if not construct the query using the 2nd pattern
-	if (groupname.indexOf("search")!=-1){
-		groupid = "1/" + pg + "/24/0?tn=1&name=&id=all&kw=" +st + "&type=1";
-	}else {
-		groupid = suburl.substring(suburl.indexOf('|')+1, suburl.indexOf('||')) + "//thumbnails/" + pg + "/24/0";
-	}
-	// Initial query to get results from the service - primary purpose is to get objectids. which in turn are required for the 2nd service call, which exposes the actual metadata
-	Zotero.Utilities.HTTP.doGet(urlstub + "secure/" + groupname + "//" + groupid, function(text) {
-		var json = JSON.parse(text);
-		items = new Object();
-		for(var i=0; i1) {
-				dialogTitle+="  " + childtitle;
-			}
-		        var sitem = child.id.substring(6,child.id.indexOf("_"));
-			webitems[sitem-1] = dialogTitle;
-			if (glow.indexOf(75)!=-1){
-				selectedNums[si]=sitem-1;
-				si++;
-			}
-	 		title = null;
-		}
-	}
-	// GET VALUES FROM THE WEB		
-	var tcount=0;
-	var newitems = null;
-	if (selectedNums.length>0){
-		newitems = new Object();
-		for (j=0; j/g, "");
-				} else {
-					newArticle.rights = child.fieldValue.replace(//g, "");
-				}
-			}
-			if (child.fieldName.indexOf("Subject")!=-1){
-				newArticle.tags.push(Zotero.Utilities.trimInternal(child.fieldValue));
-			}
-			if (child.fieldName.indexOf("Location")!=-1){
-				newArticle.tags.push(Zotero.Utilities.trimInternal(child.fieldValue));
-			}
-			if (child.fieldName.indexOf("Style Period")!=-1){
-				newArticle.tags.push(Zotero.Utilities.trimInternal(child.fieldValue));
-			}
-			if (child.fieldName.indexOf("Work Type")!=-1){
-				newArticle.tags.push(Zotero.Utilities.trimInternal(child.fieldValue));
-			}
-			if (child.fieldName.indexOf("Material")!=-1 || child.fieldName.indexOf("Technique")!=-1 ){
-				if (newArticle.artworkMedium!=null){
-					newArticle.artworkMedium+= ";" + Zotero.Utilities.trimInternal(child.fieldValue);
-				} else {
-					newArticle.artworkMedium = Zotero.Utilities.trimInternal(child.fieldValue);
-				}
-			}
-			if (child.fieldName.indexOf("Measurements")!=-1){
-				if (newArticle.artworkSize!=null){
-					newArticle.artworkSize+= ";" + Zotero.Utilities.trimInternal(child.fieldValue);
-				} else {			
-					newArticle.artworkSize = Zotero.Utilities.trimInternal(child.fieldValue);
-				}
-			}
-			if (child.fieldName.indexOf("Date")!=-1){
-				if (newArticle.date!=null){
-					newArticle.date+= ";" + Zotero.Utilities.trimInternal(child.fieldValue);
-				} else {
-					//bug here!! when date parser fails, entire object is not saved in Zotero - works in Scaffold, fails in Zotero! to patch remove all occurrences of B.C
-					newArticle.date = Zotero.Utilities.trimInternal(child.fieldValue.replace(/B.C./i, ""));
-				}
-			}
-			if (child.fieldName.indexOf("Repository")!=-1){
-				if (newArticle.repository!=null){
-					newArticle.repository+= ";" + Zotero.Utilities.trimInternal(child.fieldValue);
-				} else {			
-					newArticle.repository = Zotero.Utilities.trimInternal(child.fieldValue);
-				}
-			}
-			if (child.fieldName.indexOf("Source")!=-1){
-				if (newArticle.archiveLocation!=null){
-					newArticle.archiveLocation+= ";" + Zotero.Utilities.trimInternal(child.fieldValue);
-				} else {			
-					newArticle.archiveLocation = Zotero.Utilities.trimInternal(child.fieldValue);
-				}
-			}
-			if (child.fieldName.indexOf("Description")!=-1){
-				if (newArticle.abstractNote!=null){
-					newArticle.abstractNote+= ";" + Zotero.Utilities.trimInternal(child.fieldValue);
-				} else {
-					newArticle.abstractNote = Zotero.Utilities.trimInternal(child.fieldValue);
-				}
-			}
-			if (child.fieldName.indexOf("Collection")!=-1){
-				if (newArticle.extra!=null){
-					newArticle.extra+= ";" + Zotero.Utilities.trimInternal(child.fieldValue);
-				} else {			
-					newArticle.extra = Zotero.Utilities.trimInternal(child.fieldValue);
-				}
-			}
-		}
-		var objectId = json.objectId;
-		//this is called to get the url stub for the ARTstor viewer
-		Zotero.Utilities.HTTP.doGet(urlstub + "secure/metadata/" + objectId + "?_method=FpHtml", function(dom) {
-			var testurl = dom.substring(dom.lastIndexOf('')+21,dom.lastIndexOf('')); 
-			var t2 = "http://www.artstor.org"; 
-			var tmp2 = testurl.replace(//g, "");
-			tmp2 = tmp2.substring(0, tmp2.indexOf("&userId"));
-			//build ARTstorImageURL
-			artstorimgurl = t2+tmp2;
-			newArticle.url = artstorimgurl;
-			newArticle.callNumber = objectId;
-			newArticle.complete();
-			Zotero.done();
-		}); 
-		Zotero.wait();
-	});
-	Zotero.wait();
-});
-Zotero.wait();
-}
\ No newline at end of file
diff --git a/translators/ASCE.js b/translators/ASCE.js
deleted file mode 100644
index 16e9f657f..000000000
--- a/translators/ASCE.js
+++ /dev/null
@@ -1,76 +0,0 @@
-{
-	"translatorID":"303bdfc5-11b8-4107-bca1-63ca97701a0f",
-	"translatorType":4,
-	"label":"ASCE",
-	"creator":"Michael Berkowitz",
-	"target":"^http://ascelibrary.aip.org/.+",
-	"minVersion":"1.0.0b3.r1",
-	"maxVersion":"",
-	"priority":100,
-	"inRepository":true,
-	"lastUpdated":"2007-09-06 19:30:00"
-}
-
-function detectWeb(doc, url) {
-	if (doc.evaluate('//div[@id="sr-content-wrap"]//div[@class="sr-right"]/p[@class="sr-art-title"]/a', doc, null, XPathResult.ANY_TYPE, null).iterateNext()) {
-		return "multiple";
-	} else {
-		return "journalArticle";
-	}
-}
-
-function getRIS(doc, url) {
-	var newx = '//div[@id="sci-art-options-box"]//input[@name="SelectCheck"]';
-	var key = doc.evaluate(newx, doc, null, XPathResult.ANY_TYPE, null).iterateNext().value;
-	Zotero.debug(key);
-	var citation = 'http://ascelibrary.aip.org/getabs/servlet/GetCitation?source=scitation&PrefType=ARTICLE&PrefAction=Add+Selected&SelectCheck=' + key + '&fn=open_refworks&downloadcitation=+Go+';
-	Zotero.Utilities.HTTP.doGet(citation, function(text) {
-		var translator = Zotero.loadTranslator("import");
-		text = text.replace(/RT/, "TY");
-		text = text.replace(/VO/, "VL");
-		text = text.replace(/LK/, "UR");
-		text = text.replace(/YR/, "PY");
-		Zotero.debug(text);
-		translator.setTranslator("32d59d2d-b65a-4da4-b0a3-bdd3cfb979e7");
-		translator.setString(text.replace(/([A-Z][A-Z\d]\s)/g, "$1 - "));
-		translator.setHandler("itemDone", function(obj, item) {
-			item.attachments = [
-				{url:item.url, title:"ASCE Snapshot", mimeType:"text/html"},
-				{url:"http://ascelibrary.aip.org/getpdf/servlet/GetPDFServlet?filetype=pdf&id=" + key + "&idtype=cvips&prog=search", title:"EAS Full Text PDF", mimeType:"application/pdf"}
-			];
-			//item.itemType = "journalArticle";
-			item.complete();
-		});
-		translator.translate();
-		Zotero.wait();
-		Zotero.done();
-	});
-}
-
-function doWeb(doc, url) {
-	var articles = new Array();
-	var items = new Object();
-	var xpath = '//div[@class="sr-right"]/p[@class="sr-art-title"]/a';
-	if (doc.evaluate(xpath, doc, null, XPathResult.ANY_TYPE, null).iterateNext()) {
-		var titles = doc.evaluate(xpath, doc, null, XPathResult.ANY_TYPE, null);
-		while (new_title = titles.iterateNext()) {
-			items[new_title.href] = new_title.textContent;
-		}
-		
-		items = Zotero.selectItems(items);
-		
-		for (var i in items) {
-			articles.push(i)
-		}
-	} else {
-		var newx = '//div[@id="sci-art-options-box"]//input[@name="SelectCheck"]';
-		var stuff = doc.evaluate(newx, doc, null, XPathResult.ANY_TYPE, null).iterateNext().value;
-		Zotero.debug(stuff);
-		articles.push(url);
-	}
-
-	Zotero.debug(articles);
-	Zotero.Utilities.processDocuments(articles, getRIS, function() {Zotero.done});
-	Zotero.wait();
-
-}
diff --git a/translators/Ab Imperio.js b/translators/Ab Imperio.js
deleted file mode 100644
index 05d4aebbc..000000000
--- a/translators/Ab Imperio.js	
+++ /dev/null
@@ -1,76 +0,0 @@
-{
-        "translatorID": "f3e31f93-c18d-4ba3-9aa6-1963702b5762",
-        "label": "Ab Imperio",
-        "creator": "Avram Lyon",
-        "target": "^https?://(?:www\\.)?abimperio\\.net/",
-        "minVersion": "2.0",
-        "maxVersion": "",
-        "priority": 100,
-        "inRepository": true,
-        "translatorType": 4,
-        "lastUpdated": "2011-05-24 00:28:49"
-}
-
-/* FW LINE 46:127318f30c1d */ function flatten(c){var b=new Array();for(var d in c){var e=c[d];if(e instanceof Array){b=b.concat(flatten(e))}else{b.push(e)}}return b}var FW={_scrapers:new Array()};FW._Base=function(){this.callHook=function(b,c,e,a){if(typeof this["hooks"]==="object"){var d=this["hooks"][b];if(typeof d==="function"){d(c,e,a)}}};this.evaluateThing=function(f,e,c){var b=typeof f;if(b==="string"){return f}else{if(b==="object"){if(f instanceof Array){var d=this.evaluateThing;var a=f.map(function(g){return d(g,e,c)});return flatten(a)}else{return f.evaluate(e,c)}}else{if(b==="function"){return f(e,c)}else{return undefined}}}}};FW.Scraper=function(a){FW._scrapers.push(new FW._Scraper(a))};FW._Scraper=function(a){for(x in a){this[x]=a[x]}this._singleFieldNames=["abstractNote","applicationNumber","archive","archiveLocation","artworkMedium","artworkSize","assignee","audioFileType","audioRecordingType","billNumber","blogTitle","bookTitle","callNumber","caseName","code","codeNumber","codePages","codeVolume","committee","company","conferenceName","country","court","date","dateDecided","dateEnacted","dictionaryTitle","distributor","docketNumber","documentNumber","DOI","edition","encyclopediaTitle","episodeNumber","extra","filingDate","firstPage","forumTitle","genre","history","institution","interviewMedium","ISBN","ISSN","issue","issueDate","issuingAuthority","journalAbbreviation","label","language","legalStatus","legislativeBody","letterType","libraryCatalog","manuscriptType","mapType","medium","meetingName","nameOfAct","network","number","numberOfVolumes","numPages","pages","patentNumber","place","postType","presentationType","priorityNumbers","proceedingsTitle","programTitle","programmingLanguage","publicLawNumber","publicationTitle","publisher","references","reportNumber","reportType","reporter","reporterVolume","rights","runningTime","scale","section","series","seriesNumber","seriesText","seriesTitle","session","shortTitle","studio","subject","system","thesisType","title","type","university","url","version","videoRecordingType","volume","websiteTitle","websiteType"];this._makeAttachments=function(q,b,f,s){if(f instanceof Array){f.forEach(function(k){this._makeAttachments(q,b,k,s)},this)}else{if(typeof f==="object"){var p=f.urls||f.url;var m=f.types||f.type;var e=f.titles||f.title;var h=this.evaluateThing(p,q,b);var o=this.evaluateThing(e,q,b);var r=this.evaluateThing(m,q,b);var l=(r instanceof Array);var n=(o instanceof Array);if(!(h instanceof Array)){h=[h]}for(var j in h){var c=h[j];var g;var d;if(l){g=r[j]}else{g=r}if(n){d=o[j]}else{d=o}s.attachments.push({url:c,title:d,type:g})}}}};this.makeItems=function(o,b,m,c,l){var q=new Zotero.Item(this.itemType);q.url=b;for(var h in this._singleFieldNames){var n=this._singleFieldNames[h];if(this[n]){var g=this.evaluateThing(this[n],o,b);if(g instanceof Array){q[n]=g[0]}else{q[n]=g}}}var r=["creators","tags"];for(var f in r){var p=r[f];var d=this.evaluateThing(this[p],o,b);if(d){for(var e in d){q[p].push(d[e])}}}this._makeAttachments(o,b,this["attachments"],q);c(q,this,o,b);l([q])}};FW._Scraper.prototype=new FW._Base;FW.MultiScraper=function(a){FW._scrapers.push(new FW._MultiScraper(a))};FW._MultiScraper=function(a){for(x in a){this[x]=a[x]}this._mkSelectItems=function(e,d){var b=new Object;for(var c in e){b[d[c]]=e[c]}return b};this._selectItems=function(d,c,e){var b=new Array();Zotero.selectItems(this._mkSelectItems(d,c),function(f){for(var g in f){b.push(g)}e(b)})};this._mkAttachments=function(g,d,f){var b=this.evaluateThing(this["attachments"],g,d);var c=new Object();if(b){for(var e in f){c[f[e]]=b[e]}}return c};this._makeChoices=function(f,p,c,d,h){if(f instanceof Array){f.forEach(function(k){this._makeTitlesUrls(k,p,c,d,h)},this)}else{if(typeof f==="object"){var m=f.urls||f.url;var e=f.titles||f.title;var n=this.evaluateThing(m,p,c);var j=this.evaluateThing(e,p,c);var l=(j instanceof Array);if(!(n instanceof Array)){n=[n]}for(var g in n){var b=n[g];var o;if(l){o=j[g]}else{o=j}h.push(b);d.push(o)}}}};this.makeItems=function(j,b,g,c,f){Zotero.debug("Entering MultiScraper.makeItems");if(this.beforeFilter){var k=this.beforeFilter(j,b);if(k!=b){this.makeItems(j,k,g,c,f);return}}var e=[];var h=[];this._makeChoices(this["choices"],j,b,e,h);var d=this._mkAttachments(j,b,h);this._selectItems(e,h,function(m){if(!m){f([])}else{var l=[];var n=this.itemTrans;Zotero.Utilities.processDocuments(m,function(q){var p=q.documentURI;var o=n;if(o===undefined){o=FW.getScraper(q,p)}if(o===undefined){}else{o.makeItems(q,p,d[p],function(r){l.push(r);c(r,o,q,p)},function(){})}},function(){f(l)})}})}};FW._MultiScraper.prototype=new FW._Base;FW.DelegateTranslator=function(a){return new FW._DelegateTranslator(a)};FW._DelegateTranslator=function(a){for(x in a){this[x]=a[x]}this._translator=Zotero.loadTranslator(this.translatorType);this._translator.setTranslator(this.translatorId);this.makeItems=function(g,d,b,f,c){Zotero.debug("Entering DelegateTranslator.makeItems");var e;Zotero.Utilities.HTTP.doGet(d,function(h){this._translator.setHandler("itemDone",function(k,j){e=j;if(b){j.attachments=b}});this._translator.setString(h);this._translator.translate();f(e)},function(){c([e])})}};FW.DelegateTranslator.prototype=new FW._Scraper;FW._StringMagic=function(){this._filters=new Array();this.addFilter=function(a){this._filters.push(a);return this};this.split=function(a){return this.addFilter(function(b){return b.split(a).filter(function(c){return(c!="")})})};this.replace=function(c,b,a){return this.addFilter(function(d){if(d.match(c)){return d.replace(c,b,a)}else{return d}})};this.prepend=function(a){return this.replace(/^/,a)};this.append=function(a){return this.replace(/$/,a)};this.remove=function(b,a){return this.replace(b,"",a)};this.trim=function(){return this.addFilter(function(a){return Zotero.Utilities.trim(a)})};this.trimInternal=function(){return this.addFilter(function(a){return Zotero.Utilities.trimInternal(a)})};this.match=function(a,b){if(!b){b=0}return this.addFilter(function(d){var c=d.match(a);if(c===undefined||c===null){return undefined}else{return c[b]}})};this.cleanAuthor=function(b,a){return this.addFilter(function(c){return Zotero.Utilities.cleanAuthor(c,b,a)})};this.key=function(a){return this.addFilter(function(b){return b[a]})};this.capitalizeTitle=function(){return this.addFilter(function(a){return Zotero.Utilities.capitalizeTitle(a)})};this.unescapeHTML=function(){return this.addFilter(function(a){return Zotero.Utilities.unescapeHTML(a)})};this.unescape=function(){return this.addFilter(function(a){return unescape(a)})};this._applyFilters=function(c,e){for(i in this._filters){c=flatten(c);c=c.filter(function(a){return((a!==undefined)&&(a!==null))});for(var d=0;d0&&a[0]){return f}}}return undefined};FW.getScraper=function(b,a){var c=FW.detectWeb(b,a);return FW._scrapers.filter(function(d){return(d.evaluateThing(d.itemType,b,a)==c)&&(d.evaluateThing(d.detect,b,a))})[0]};FW.doWeb=function(c,a){Zotero.debug("Entering FW.doWeb");var b=FW.getScraper(c,a);b.makeItems(c,a,[],function(f,e,g,d){e.callHook("scraperDone",f,g,d);if(!f.title){f.title=""}f.complete()},function(){Zotero.done()});Zotero.wait();Zotero.debug("Leaving FW.doWeb")};
-
-/*
-   Ab Imperio Translator
-   Copyright (C) 2011 Avram Lyon, ajlyon@gmail.com
-
-   This program is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation, either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see .
- */
-
-function detectWeb(doc, url) { 
-		return FW.detectWeb(doc, url);
-}
-function doWeb(doc, url) { return FW.doWeb(doc, url); }
-
-
-/** Articles */
-FW.Scraper({ itemType         : 'journalArticle',
-             detect           : FW.Xpath('//center[h3]/h3'),
-             title            : FW.Xpath('//center[h3]/h3').text().trim(),
-             attachments      : [
-				{
-					url :	FW.Xpath('//a[contains(@href,"pdf") and contains(text(),"PDF")]').key("href"),
-					type :	"application/pdf",
-					title: 	"Ab Imperio PDF"
-				},
-				{
-					url :	FW.Url(),
-					type :	"text/html",
-					title: 	"Ab Imperio Snapshot"
-				},
-				{
-					url :	FW.Xpath('//table//td/a[img[contains(@src,"doc.gif")]]').key("href"),
-					type :	"text/html",
-					title: 	"Ab Imperio Snapshot"
-				}],
-             creators         : FW.Xpath('//center[h3]').text().remove(/^[^\n]*\n/).remove(/\n.*/).cleanAuthor("author"),
-             // Of course, release date is always later, but we'll still call this a date and not a volume
-             date             : FW.Xpath('//center[h3]/font').text().match(/\/([0-9]{4})/,1),
-             issue            : FW.Xpath('//center[h3]/font').text().match(/([0-9]+)\//,1),
-             abstractNote     : FW.Xpath('//center[h3]/following-sibling::p[1]').text(),
-             publicationTitle : "Ab Imperio" 
-});
-
-/* This can be thrown off by articles that the user doesn't have access to... */
-/** Search results */
-FW.MultiScraper({ itemType  : "multiple",
-                  detect    : FW.Url().match(/state=(?:shown|srch)/),
-                  choices : {
-	          	titles    : FW.Xpath('//a[contains(@href,"state=showa")]').text(),
-                  	urls      : FW.Xpath('//a[contains(@href,"state=showa")]').key('href').text()
-                  }
-});
diff --git a/translators/AcademicJournals.net.js b/translators/AcademicJournals.net.js
deleted file mode 100644
index 3980557e9..000000000
--- a/translators/AcademicJournals.net.js
+++ /dev/null
@@ -1,91 +0,0 @@
-{
-	"translatorID":"252c6a50-0900-41c5-a66b-ec456137c43c",
-	"translatorType":4,
-	"label":"AcademicJournals.net",
-	"creator":"Michael Berkowitz",
-	"target":"http://www.academicjournals.net/",
-	"minVersion":"1.0.0b4.r5",
-	"maxVersion":"",
-	"priority":100,
-	"inRepository":true,
-	"lastUpdated":"2009-01-08 08:19:07"
-}
-
-function detectWeb(doc, url) {
-	if (url.match('articleno=')) {
-		return "journalArticle";
-	} else if (url.match('issueno=') || url.match('current.php')) {
-		return "multiple";
-	}
-}
-
-function doWeb(doc, url) {
-	var namespace = doc.documentElement.namespaceURI;
-	var nsResolver = namespace ? function(prefix) {
-		if (prefix == 'x') return prefix; else return null;
-	} : namespace;
-	
-	var arts = new Array();
-	if (detectWeb(doc, url) == "multiple") {
-		var items = new Object();
-		var titles = doc.evaluate('//tr[2]/td//table/tbody/tr[1]/td[2]/font', doc, nsResolver, XPathResult.ANY_TYPE, null);
-		var title;
-		var links = doc.evaluate('//tr[4]/td[2]/div/a[@class="links"]', doc, nsResolver, XPathResult.ANY_TYPE, null);
-		var link;
-		while ((title = titles.iterateNext()) && (link = links.iterateNext())) {
-			items[link.href] = Zotero.Utilities.trimInternal(title.textContent);
-		}
-		items = Zotero.selectItems(items);
-		for (var i in items) {
-			arts.push(i);
-		}
-	} else {
-		arts = [url];
-	}
-	Zotero.Utilities.processDocuments(arts, function(doc) {
-		var item = new Zotero.Item("journalArticle");
-		item.url = doc.location.href;
-		//title
-		item.title = Zotero.Utilities.trimInternal(doc.evaluate('//td[2]/table/tbody/tr/td/div/font', doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent);
-		
-		//voliss, etc.
-		var voliss = doc.evaluate('//table/tbody/tr/td[2]/font/font', doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent;
-		voliss = voliss.match(/^([^\d]+)(\d+)\s+\((\d+)\):\s+([\d\-]+),\s+(\d+)/);
-		Zotero.debug(voliss);
-		item.publicationTitle = voliss[1];
-		item.volume = voliss[2];
-		item.issue = voliss[3];
-		item.pages = voliss[4];
-		item.date = voliss[5];
-		
-		//authors
-		var authorsx = doc.evaluate('//td[2]/font/a[@class="links"]/font', doc, nsResolver, XPathResult.ANY_TYPE, null);
-		var author;
-		var authors = new Array();
-		while (author = authorsx.iterateNext()) {
-			authors.push(author.textContent);
-		}
-		for each (var aut in authors) {
-			item.creators.push(Zotero.Utilities.cleanAuthor(aut, "author"));
-		}
-		
-		item.abstractNote = Zotero.Utilities.trimInternal(doc.evaluate('//table/tbody/tr/td/div/table/tbody/tr/td[2]/div/font', doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent);
-		
-		//attachments
-		var pdfurl = doc.evaluate('//a[contains(@href, ".pdf")]', doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().href;
-		item.attachments = [
-			{url:item.url, title:"AcademicJournals.net Snapshot", mimeType:"text/html"},
-			{url:pdfurl, title:"AcademicJournals.net PDF", mimeType:"application/pdf"}
-		];
-		
-		//tags
-		var tagspath = doc.evaluate('//tbody/tr/td/table/tbody/tr[2]/td/font/a[@class="links"]/font', doc, nsResolver, XPathResult.ANY_TYPE, null);
-		var tag;
-		var tags = new Array();
-		while (tag = tagspath.iterateNext()) {
-			tags.push(tag.textContent);
-		}
-		item.tags = tags;
-		item.complete();
-	}, function() {Zotero.done();});
-}
\ No newline at end of file
diff --git a/translators/AdvoCAT.js b/translators/AdvoCAT.js
deleted file mode 100644
index 0792b437e..000000000
--- a/translators/AdvoCAT.js
+++ /dev/null
@@ -1,117 +0,0 @@
-{
-	"translatorID":"138de272-0d2a-4ab5-8cfb-0fd879958d04",
-	"translatorType":4,
-	"label":"AdvoCAT",
-	"creator":"Adam Crymble",
-	"target":"^http://(142.57.32.51|library.lsuc.on.ca)",
-	"minVersion":"1.0.0b4.r5",
-	"maxVersion":"",
-	"priority":100,
-	"inRepository":true,
-	"lastUpdated":"2008-07-25 17:40:00"
-}
-
-function detectWeb(doc, url) {
-	if (doc.location.href.match("Search_Code")) {
-		return "multiple";
-	} else if (doc.title.match("Record View")) {
-		return "book";
-	}
-}
-
-function associateData (newItem, dataTags, field, zoteroField) {
-	if (dataTags[field]) {
-		newItem[zoteroField] = dataTags[field];
-	}
-}
-
-function scrape(doc, url) {
-	var namespace = doc.documentElement.namespaceURI;
-	var nsResolver = namespace ? function(prefix) {
-		if (prefix == 'x') return namespace; else return null;
-	} : null;	
-	
-	var dataTags = new Object();
-	var fieldTitle;
-	
-	var newItem = new Zotero.Item("book");
-
-	var headers = doc.evaluate('//table[2]/tbody/tr/th', doc, nsResolver, XPathResult.ANY_TYPE, null);
-	var xPathCount = doc.evaluate('count (//table[2]/tbody/tr/th)', doc, nsResolver, XPathResult.ANY_TYPE, null);
-	var contents = doc.evaluate('//table[2]/tbody/tr/td', doc, nsResolver, XPathResult.ANY_TYPE, null);
-
-	for (i=0; i