Skip to content

Instantly share code, notes, and snippets.

@TristanWiley
Created August 21, 2016 00:32
Show Gist options
  • Save TristanWiley/0af316cda52b71106e06a67d973eee62 to your computer and use it in GitHub Desktop.
Save TristanWiley/0af316cda52b71106e06a67d973eee62 to your computer and use it in GitHub Desktop.
if (!window.jQuery) {
var jq = document.createElement('script');
jq.type = 'text/javascript';
jq.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js';
var jq2 = document.createElement('script');
jq2.type = 'text/javascript';
jq2.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'cdn.rawgit.com/blueimp/JavaScript-MD5/master/js/md5.js';
var sc = document.getElementsByTagName('script')[0];
sc.parentNode.insertBefore(jq, sc);
sc.parentNode.insertBefore(jq2, jq);
}
$.each($('.channels-wrap .channel-name'), function( index, value ) {
var title = $(value).text();
var hash = md5(reverseString(title));
var count = (hash.match(/a/g) || []).length;
$(value).append(" " + count);});
function reverseString(str) {
var strArray = str.split("");
strArray.reverse();
var strReverse = strArray.join("");
return strReverse;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment