Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Changes due to new web site html
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Waterman committed Jul 10, 2015
1 parent 0545285 commit 0054271
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/versions-fetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ var validate = function (data) {
return dfd.promise;
};

var parentDirRegex = /Parent Directory/i;
var lineRegEx = /<img.*> <a href=\"(.+)\">(.+)<\/a>\s+(\d{2}-\w{3}-\d{4} \d{2}:\d{2})/;
var lineRegEx = /<img[^>]* alt=\"\[DIR\]\">[^<]*<a\s+href=\"(.+)\">([^<]+)<\/a>\s*(\d{4}-\d{2}-\d{2} \d{2}:\d{2})/;
var crosswalkPackageNameRegex = /^(\d+\.\d+\.\d+\.\d+)\/$/;

// get all the files after the "Parent Directory" link in a standard
Expand All @@ -91,11 +90,9 @@ var parseApacheIndex = function (url, content) {
var files = [];

for (var i = 0; i < lines.length; i += 1) {
if (parentDirRegex.test(lines[i])) {
continue;
}
var thisLine = lines[i];

var matches = lines[i].match(lineRegEx);
var matches = thisLine.match(lineRegEx);

if (matches) {
files.push({
Expand Down Expand Up @@ -166,7 +163,8 @@ VersionsFetcher.prototype.getDownloads = function (channel) {
.then(
function () {
url = _.template(VersionsFetcher.DOWNLOADS_URL_TPL, data);
return self.getUrl(url);
var urlPromise = self.getUrl(url);
return urlPromise;
}
)
.then(
Expand Down

0 comments on commit 0054271

Please sign in to comment.