-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- use parseInt to convert strings to numbers - add missing semicolon - bump version
- Loading branch information
Showing
1 changed file
with
6 additions
and
4 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,8 @@ | |
// @author vBm <[email protected]> | ||
// @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); | ||
}); |