{
"translatorID": "b61c224b-34b6-4bfd-8a76-a476e7092d43",
"label": "SSRN",
"creator": "Sebastian Karcher",
"target": "^https?://papers\\.ssrn\\.com/",
"minVersion": "3.0",
"maxVersion": "",
"priority": 100,
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsbv",
"lastUpdated": "2013-09-25 15:23:47"
}
/*
SSRN Translator
Copyright (C) 2013 Sebastian Karcher
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
function detectWeb(doc,url) {
var xpath='//meta[@name="citation_title"]';
if (ZU.xpath(doc, xpath).length > 0) {
return "report";
}
if (url.search(/AbsByAuth\.cfm\?|results\.cfm\?/i)!=-1) {
return "multiple";
}
return false;
}
function doWeb(doc,url)
{
if (detectWeb(doc, url) == "multiple") {
var hits = {};
var urls = [];
//this one is for searches and publication series:
var results = ZU.xpath(doc, "//tr/td//strong/a[(@class='textlink' or @class='textLink') and contains(@href, 'papers.cfm?abstract_id')]");
//otherwise, this is an author page
if(results.length<1){
results = ZU.xpath(doc,"//tr[contains(@id, 'row_') or contains(@id, '_version')]//a[@class='textlink' and contains(@href, 'ssrn.com/abstract=')]");
}
for(var i=0, n=results.length; i