HighWire 2.0 pdf downloading problem (and fix)
The HighWire 2.0 translator failed to download the pdf for this url:
http://plantgenome.scijournals.org/content/2/2/134
looking at the code, this is the line that needs to be fixed:
var pdfurl = newurl.slice(0, newurl.lastIndexOf(".")) + ".full.pdf";
that only works if the url is www.blah.com/blah.html, which is not always the case. If you replace that line with the following, it downloads the pdf just fine:
var dotidx = newurl.lastIndexOf(".");
var slashidx = newurl.lastIndexOf("/");
if(dotidx < slashidx) {
var pdfurl = newurl + ".full.pdf";
} else {
var pdfurl = newurl.slice(0, dotidx) + ".full.pdf";
}
Please consider modifying the translator along these lines.
Thanks,
Keith
http://plantgenome.scijournals.org/content/2/2/134
looking at the code, this is the line that needs to be fixed:
var pdfurl = newurl.slice(0, newurl.lastIndexOf(".")) + ".full.pdf";
that only works if the url is www.blah.com/blah.html, which is not always the case. If you replace that line with the following, it downloads the pdf just fine:
var dotidx = newurl.lastIndexOf(".");
var slashidx = newurl.lastIndexOf("/");
if(dotidx < slashidx) {
var pdfurl = newurl + ".full.pdf";
} else {
var pdfurl = newurl.slice(0, dotidx) + ".full.pdf";
}
Please consider modifying the translator along these lines.
Thanks,
Keith