Skip to content

Commit

Permalink
that should do the trick for downloading all the latest articles of a…
Browse files Browse the repository at this point in the history
… medium user
  • Loading branch information
EffinMaggie committed Sep 30, 2014
1 parent e395de5 commit 82b1d2d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/reave.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ function fetch (http, URL, pageCallback, base64) {
});
}

function replace ($, pageCallback) {
function replace ($, URL, pageCallback) {
var n = $('img[src^="https:"]').first(),
u = n.attr('src');
if (u) {
fetch(https, u, function(data, type) {
n.attr('src', 'data:' + type + ';base64,' + data);
return replace($, pageCallback);
return replace($, URL, pageCallback);
}, true);
}
else {
pageCallback($.xml());
pageCallback(URL, $.xml());
}
}

Expand Down Expand Up @@ -90,7 +90,7 @@ function medium (URL, pageCallback) {
$(this).replaceWith($(this).children());
});

replace($, pageCallback);
replace($, URL, pageCallback);
});
}

Expand All @@ -102,7 +102,7 @@ function mediumUser (URL, pageCallback) {
var user = $('meta[property="profile:username"]').attr('content');

$('h3 a[href^="/@'+user+'"]').each(function(_, e) {
console.log($(this).attr('href'));
medium(url.resolve(URL,$(this).attr('href')), pageCallback);
});
});
}
Expand Down

0 comments on commit 82b1d2d

Please sign in to comment.