Created
April 5, 2014 14:30
-
-
Save ColdDevil/9992718 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"translatorID":"04623cf0-313c-11df-9aae-0800200c9a68", | |
"translatorType":2, | |
"label":"ZotSelect Link (Full)", | |
"creator":"Florian Weßling", | |
"target":"html", | |
"minVersion":"2.0", | |
"maxVersion":"", | |
"priority":200, | |
"inRepository":false, | |
"displayOptions":{"exportCharset":"UTF-8"}, | |
"lastUpdated":"2014-04-05 12:34:56" | |
} | |
// save this file at: /Users/YOURNAME/Library/Application Support/Zotero/Profiles/abc123xyz.default/zotero/translators | |
function doExport() { | |
var output = ""; | |
var item; | |
while(item = Zotero.nextItem()) { | |
// title and link | |
var selectLink = "zotero://select/items/"; | |
var library_id = item.libraryID ? item.libraryID : 0; | |
selectLink += library_id + "_" + item.key; | |
output += ""<a href=\"" + selectLink + "\">" + item.title + "</a>""; // “ ” | |
var addition = ""; | |
// authors | |
var authors = ""; | |
if (item.creators !== undefined) { | |
for (var a = 0; a < item.creators.length; a++) { | |
if (item.creators[a]["creatorType"] == "author") { | |
if (authors.length > 0) { | |
authors += ", "; | |
} | |
authors += item.creators[a]["lastName"]; // + ", " + item.creators[a]["firstName"]; | |
} | |
} | |
addition += authors; | |
} | |
// publication title | |
if (item.publicationTitle !== undefined && item.publicationTitle.length > 0) { | |
addition += "; " + item.publicationTitle; | |
} | |
// date | |
if (item.date !== undefined && item.date.length > 0) { | |
addition += ", " + item.date; | |
} | |
// DOI | |
if (item.DOI !== undefined && item.DOI.length > 0) { | |
addition += ", " + item.DOI; | |
} | |
if (addition.length > 0) { | |
output += " (" + addition + ")"; | |
} | |
output += "<br />"; | |
Zotero.debug(item); | |
} | |
Zotero.write(output); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment