diff --git a/remaining.episodes.followshows.user.js b/remaining.episodes.followshows.user.js index df0bcc1..e6d558c 100644 --- a/remaining.episodes.followshows.user.js +++ b/remaining.episodes.followshows.user.js @@ -6,8 +6,8 @@ // @author vBm // @oujs:author vBm // @include http://followshows.com/user/* -// @version 1 -// @date 20/07/2014 +// @version 2 +// @date 22/07/2014 // @grant none // ==/UserScript== @@ -28,8 +28,10 @@ $.ajax({ }).done(function(data) { var totalEpisodes = []; $(data).find('.stats').each(function() { - totalEpisodes.push($(this).text().match(/\d+/)[0]) + totalEpisodes.push(parseInt($(this).text().match(/\d+/)[0], 10)); + }); + var totalEpisodesSum = totalEpisodes.reduce(function(a, b) { + return a + b; }); - var totalEpisodesSum = eval(totalEpisodes.join('+')); $('.addic7ed').text(totalEpisodesSum); });