Skip to content

Instantly share code, notes, and snippets.

@qbit
Last active December 25, 2015 00:09
Show Gist options
  • Save qbit/6886027 to your computer and use it in GitHub Desktop.
Save qbit/6886027 to your computer and use it in GitHub Desktop.
lobste.rs filter data
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