Last active
June 22, 2016 20:59
-
-
Save joshleblanc/984aefedca4cd36b1b27 to your computer and use it in GitHub Desktop.
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
// ==UserScript== | |
// @name Show user's league | |
// @namespace http://screddit.com | |
// @version 1.7 | |
// @description Show a user's 1v1 league | |
// @author Cereal | |
// @match http://*.battle.net/forums/*/sc2/topic/* | |
// @grant none | |
// ==/UserScript== | |
/* jshint -W097 */ | |
'use strict'; | |
$('head').append('<link xmlns="http://www.w3.org/1999/xhtml" rel="stylesheet" type="text/css" media="all" href="http://us.battle.net/sc2/static/css/sc2.css?v=46" />'); | |
var $posts = $('.Topic-content > .TopicPost'); | |
$posts.each(function(i, el) { | |
var profileLink = $(el).find('.Author-name--profileLink'); | |
$.get(profileLink[0].href).done(function(res) { | |
var badge = $(res).find('.module-body > .badge-item > .badge')[0]; | |
$(el).find('.TopicPost-author .Author-details').append(badge); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment