Skip to content

Commit

Permalink
Fixes #21 : Mastering heroe
Browse files Browse the repository at this point in the history
  • Loading branch information
gclement authored and gclement committed May 29, 2018
1 parent 0025b3a commit d4db86b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/overwatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,21 +166,24 @@ let OverwatchProvider = function () {
stats[item.find('.card-copy').text().sanitize()] = item.find('.card-heading').text().cast();
});

stats.masteringHeroe = $('#overview-section > .masthead-hero-image').attr(`data-hero-${gameType}`);
stats.masteringHeroe = $('[data-js="heroMastheadImage"]').attr(`data-hero-${gameType}`);

return stats;
}

let parseHeroesStats = ($, gametype, overallOnly = false) => {
var heroesMap = [];
var stats = {};
stats[gametype] = {};

//// Master stats
_.each($(`#${gametype} > .career-stats-section option`), (item) => {
heroesMap.push({ name: item.attribs['option-id'].toLowerCase().sanitize(), value: item.attribs['value'] });

if (overallOnly)
return false;
});

//// Seeking heroe datas
_.each(heroesMap, (map) => {
stats[map.name] = {};
Expand Down

0 comments on commit d4db86b

Please sign in to comment.