Trans: Re-enable PDF downloading for Frontiers; depends on r7614

This commit is contained in:
Avram Lyon 2011-01-11 17:17:41 +00:00
parent fed87c5441
commit f58330b451

View file

@ -2,18 +2,18 @@
"translatorID":"cb9e794e-7a65-47cd-90f6-58cdd191e8b0", "translatorID":"cb9e794e-7a65-47cd-90f6-58cdd191e8b0",
"label":"Frontiers", "label":"Frontiers",
"creator":"Jason Friedman", "creator":"Jason Friedman",
"target":"^http://www.frontiersin.org.*/", "target":"^https?://www\\.frontiersin\\.org.*/",
"minVersion":"1.0", "minVersion":"2.0.10",
"maxVersion":"", "maxVersion":"",
"priority":100, "priority":100,
"inRepository":"1", "inRepository":"1",
"translatorType":4, "translatorType":4,
"lastUpdated":"2010-12-28 23:21:54" "lastUpdated":"2011-01-11 23:21:54"
} }
/* /*
Frontiers translator Frontiers translator
Copyright (C) 2009-2010 Jason Friedman, write.to.jason@gmail.com Copyright (C) 2009-2011 Jason Friedman, write.to.jason@gmail.com
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -273,13 +273,11 @@ function scrape(doc,url) {
var matches = doc.body.innerHTML.match(/downloadfile.aspx.fileid=([^']*)/); var matches = doc.body.innerHTML.match(/downloadfile.aspx.fileid=([^']*)/);
// The attachments are being rejected as PDF files because the first line does not contain
// %PDF (although the second line does)
if (matches!=null) { if (matches!=null) {
var pdfurl = 'http://www.frontiersin.org/journal/downloadfile.aspx?fileid=' + matches[1]; var pdfurl = 'http://www.frontiersin.org/journal/downloadfile.aspx?fileid=' + matches[1];
// newItem.attachments = [ newItem.attachments = [
// {url:pdfurl, title:"Full text PDF", mimeType:"application/pdf"} {url:pdfurl, title:"Full text PDF", mimeType:"application/pdf"}
// ]; ];
} }
newItem.complete(); newItem.complete();
} }