diff --git a/lib/reave.js b/lib/reave.js index 65e117a..6c2fa80 100644 --- a/lib/reave.js +++ b/lib/reave.js @@ -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()); } } @@ -90,7 +90,7 @@ function medium (URL, pageCallback) { $(this).replaceWith($(this).children()); }); - replace($, pageCallback); + replace($, URL, pageCallback); }); } @@ -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); }); }); }