Created
June 7, 2013 16:16
-
-
Save cfg/5730452 to your computer and use it in GitHub Desktop.
Download a Land Rover/Range Rover manual from Topix.
Run on a page like: http://topix.landrover.jlrext.com/topix/service/document/225542 (iframe from the service manual page). Download links with cURL, assemble using Acrobat or similar.
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
links=[]; all=[]; | |
function n(n){ | |
return n > 9 ? "" + n: "0" + n; | |
} | |
jQuery('#treeroot a').each(function(ix, val){ | |
e=jQuery(this); | |
h='http://topix.landrover.jlrext.com/topix/service/procedure/225542/PDF/' + e.attr('rel').split('#')[0] + '/en_GB'; | |
t=e.find('nobr').text(); | |
links.push(h); | |
all.push([t,h]); | |
}); | |
all_json = JSON.stringify(all); | |
links_json = JSON.stringify(links); | |
for( x = 0; x < links.length; x++ ) { | |
console.log("curl -s -S %s > %s.pdf", links[x], n(x)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment