{ "translatorID": "6b0b11a6-9b77-4b49-b768-6b715792aa37", "label": "Toronto Star", "creator": "Adam Crymble, Avram Lyon", "target": "^https?://www\\.thestar\\.com", "minVersion": "3.0", "maxVersion": "", "priority": 100, "inRepository": true, "translatorType": 4, "browserSupport": "gcsibv", "lastUpdated": "2014-04-04 10:01:02" } function detectWeb(doc, url) { if (url.indexOf("search") != -1 && url.indexOf("classifieds") == -1) { return "multiple"; } else if (ZU.xpathText(doc, '//div[@class="article-headline"]/h2|//div[@class="article-headline"]/h1')) { return "newspaperArticle"; } else if (ZU.xpathText(doc, '//div[@class="blog-headline"]/strong', doc)){ return "blogPost" } } //Toronto Star translator. code by Adam Crymble function scrape(doc, url) { var newItem = new Zotero.Item(detectWeb(doc, url)); if (newItem.itemType == "newspaperArticle"){ var date = ZU.xpathText(doc, '//span[@class="published-date"]'); if(date) { newItem.date = date.replace(/Published on/,'').replace(/[,\n\t\s]*$/, "").trim(); } newItem.abstractNote = ZU.xpathText(doc, '//meta[@name="description"]/@content'); var comma = false; var authorNode = ZU.xpathText(doc, '//div[@class="article-authors"]/span[@class="credit"]'); if (authorNode) authorNode = authorNode.split(/\s*,\s*/); var authorNode2 =ZU.xpathText(doc, '//span[@class="columnistLabel"]/a'); if (authorNode2) { authorNode = authorNode2.split(/\s*[;,]\s*/); comma = false;} var author; if (authorNode){ for(var i=0, n=authorNode.length; i