Created
August 23, 2013 10:27
-
-
Save IanMulvany/6317811 to your computer and use it in GitHub Desktop.
Just showing the quick changes I have been making in function buildDocs(cb) {
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
// From > | |
// This needs to be tweaked for every type of source | |
var id = /elife(\d+)\.xml/.exec(url)[1]; | |
// TO : | |
// This needs to be tweaked for every type of source | |
// as an id we want anything between the last "/" and the last ".xml" | |
var urlParts = url.split("/"); | |
// pick up the last elemet of the url | |
var xmlFilename = urlParts.pop(); | |
console.log(xmlFilename); | |
// drop ".xml" | |
var id = xmlFilename.replace('.xml', ''); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment