PDF url fixes from nxmehta in the forums

This commit is contained in:
Matt Burton 2009-03-31 23:21:26 +00:00
parent ff5631d9ec
commit 12229b3509
2 changed files with 2 additions and 1 deletions

View File

@ -62,6 +62,7 @@ function scrape(doc) {
var typeLink;
while(typeLink = typeLinks.iterateNext()) {
var linkText = typeLink.textContent.toLowerCase();
linkText = linkText.replace(/(\t|\n| )/g, "");
if(linkText == "pdf") {
attachments.push({title:"ACM Full Text PDF", mimeType:"application/pdf", url:typeLink.href});
url = typeLink.href;

View File

@ -115,7 +115,7 @@ function doWeb(doc, url) {
var pdfpath = '//td[2][@class="bodyCopyBlackLarge"]/a[@class="bodyCopy"][substring(text(), 1, 3) = "PDF"]';
var pdfurlElmt = newDoc.evaluate(pdfpath, newDoc, namespace, XPathResult.ANY_TYPE, null).iterateNext();
if (pdfurlElmt) {
pdfurlElmt.href = pdfurlElmt.href.substr(0,32) + 'PDF/getPDF' + pdfurlElmt.href.substr(38);
pdfurlElmt.href = pdfurlElmt.href.replace("/stamp.jsp", "PDF/getPDF.jsp");
item.attachments = [{url:pdfurlElmt.href, title:"IEEE Xplore Full Text PDF", mimeType:"application/pdf"}];
}
item.complete();