Last active
December 25, 2015 00:09
-
-
Save qbit/6886027 to your computer and use it in GitHub Desktop.
lobste.rs filter data
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
var tagData = []; | |
$('#story_tags_a option').each(function() { | |
var count = $(this).attr('data-html').replace(/.*<em>(.*)<\/em>.*/, "$1"), val, o = {}; | |
if ( count.match(/\d/) ) { | |
o.value = count.replace(/^(\d+).*/, "$1"); | |
} else { | |
o.value = 0; | |
} | |
o.label = $(this).val(); | |
//console.log("%s : %s", val, count); | |
tagData.push(o); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment