{ "translatorID": "1e6d1529-246f-4429-84e2-1f1b180b250d", "label": "The Chronicle of Higher Education", "creator": "Simon Kornblith, Avram Lyon", "target": "^https?://chronicle\\.com/", "minVersion": "2.1", "maxVersion": "", "priority": 100, "inRepository": true, "translatorType": 4, "browserSupport": "gcsbv", "lastUpdated": "2013-12-09 23:24:00" } /* This translator works on articles posted in The Chronicle of Higher Education. It is based on the earlier translator by Simon Kornblith, but the Chronicle has significantly restructured the site since 2006, breaking the old translator. */ function detectWeb(doc, url) { /* The /daily/ and /weekly/ sections are leftover from the previous version of the translator; they don't appear to still be on the Chronicle site, but they might persist in older URLs. */ var articleRegexp = /\/(daily|weekly|article|blogPost|blogs\/\w+)\/[^/]+\// ; if(articleRegexp.test(url) && ZU.xpathText(doc, '//h1')) { var section = url.match(articleRegexp); switch (section[1]) { case "weekly": case "daily": case "article": return "magazineArticle"; case "blogPost": return "blogPost"; default: if (section[1].indexOf("blogs") !== -1) return "blogPost"; return false; } } else { // This approach, used again below, is pretty crude. var aTags = doc.getElementsByTagName("a"); for(var i=0; i 0) { item.pages = data[4]; // If the section here and in the page proper are different, concatenate if (item.section !== data[1]) item.section = item.section + " : " + Zotero.Utilities.trimInternal(data[1]); // Since newspaperArticle doesn't have Volume / Issue, put as Edition item.edition = "Volume " + data[2] + ", Issue " + data[3]; } } } item.attachments.push({url:doc.location.href, title: ("Chronicle of Higher Education Snapshot"), mimeType:"text/html"}); item.complete(); } function parseAuthors(author) { // Sometimes we have "By Author and Author" if(author.substr(0, 3).toLowerCase() == "by ") { author = author.substr(3); } // Sometimes the author is in all caps var pieces = author.split(" "); for (var i = 0; i < pieces.length; i++) { // TODO Make the all-caps character class more inclusive if (pieces[i].match(/[A-Z-]+/) !== null) pieces[i] = Zotero.Utilities.capitalizeTitle(pieces[i].toLowerCase(), true); } author = pieces.join(" "); // Somtimes we have multiple authors var authors = author.split(" and "); return authors; } /** BEGIN TEST CASES **/ var testCases = [ { "type": "web", "url": "http://chronicle.com/blogs/profhacker/the-second-day-of-thatcamp/23068", "items": [ { "itemType": "blogPost", "creators": [ { "firstName": "Amy", "lastName": "Cavender", "creatorType": "author" } ], "notes": [], "tags": [], "seeAlso": [], "attachments": [ { "title": "Chronicle of Higher Education Snapshot", "mimeType": "text/html" } ], "url": "http://chronicle.com/blogs/profhacker/the-second-day-of-thatcamp/23068", "publicationTitle": "The Chronicle of Higher Education Blogs: ProfHacker", "ISSN": "0009-5982", "date": "March 26, 2010", "title": "The Second Day of THATCamp", "libraryCatalog": "The Chronicle of Higher Education", "accessDate": "CURRENT_TIMESTAMP" } ] }, { "type": "web", "url": "http://chronicle.com/article/A-Little-Advice-From-32000/46210/", "items": [ { "itemType": "magazineArticle", "creators": [ { "firstName": "Adam", "lastName": "Fagen", "creatorType": "author" }, { "firstName": "Kimberly Suedkamp", "lastName": "Wells", "creatorType": "author" } ], "notes": [], "tags": [], "seeAlso": [], "attachments": [ { "title": "Chronicle of Higher Education Snapshot", "mimeType": "text/html" } ], "url": "http://chronicle.com/article/A-Little-Advice-From-32000/46210/", "publicationTitle": "The Chronicle of Higher Education", "ISSN": "0009-5982", "date": "January 14, 2002", "title": "A Little Advice From 32,000 Graduate Students", "section": "Advice", "libraryCatalog": "The Chronicle of Higher Education", "accessDate": "CURRENT_TIMESTAMP" } ] }, { "type": "web", "url": "http://chronicle.com/article/Grinnells-Green-Secrets/2653/", "items": [ { "itemType": "magazineArticle", "creators": [ { "firstName": "Xiao-Bo", "lastName": "Yuan", "creatorType": "author" } ], "notes": [], "tags": [], "seeAlso": [], "attachments": [ { "title": "Chronicle of Higher Education Snapshot", "mimeType": "text/html" } ], "url": "http://chronicle.com/article/Grinnells-Green-Secrets/2653/", "publicationTitle": "The Chronicle of Higher Education", "ISSN": "0009-5982", "date": "June 16, 2006", "title": "Grinnell's Green Secrets", "section": "News : Short Subjects", "pages": "A9", "edition": "Volume 52, Issue 41", "libraryCatalog": "The Chronicle of Higher Education", "accessDate": "CURRENT_TIMESTAMP" } ] }, { "type": "web", "url": "http://chronicle.com/blogPost/humanities-cyberinfrastructure-project-bamboo/6138", "items": [ { "itemType": "blogPost", "creators": [ { "firstName": "Stan", "lastName": "Katz", "creatorType": "author" } ], "notes": [], "tags": [], "seeAlso": [], "attachments": [ { "title": "Chronicle of Higher Education Snapshot", "mimeType": "text/html" } ], "url": "http://chronicle.com/blogPost/humanities-cyberinfrastructure-project-bamboo/6138", "publicationTitle": "The Chronicle of Higher Education", "ISSN": "0009-5982", "date": "July 17, 2008, 01:29 PM ET", "title": "Humanities Cyberinfrastructure: Project Bamboo", "libraryCatalog": "The Chronicle of Higher Education", "accessDate": "CURRENT_TIMESTAMP", "shortTitle": "Humanities Cyberinfrastructure" } ] }, { "type": "web", "url": "http://chronicle.com/section/Opinion-Ideas/40/?eio=58977", "items": "multiple" }, { "type": "web", "url": "http://chronicle.com/search/?search_siteId=5&contextId=&action=rem&searchQueryString=adjunct", "items": "multiple" } ] /** END TEST CASES **/