Skip to content

Instantly share code, notes, and snippets.

@artlung
Last active September 30, 2015 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save artlung/942b8479f7a84214449f to your computer and use it in GitHub Desktop.
Save artlung/942b8479f7a84214449f to your computer and use it in GitHub Desktop.
show unpopular posts on a tumblr users archive page
// use on a tumblr users archive page
// http://<USERNAME>.tumblr.com/archive
// open developer console (see: http://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers)
// paste this code in and run it
// as you scroll, any posts that are popular are hidden
// you can change the MINIMUM_TO_BE_POPULAR value to a valid number to change
var MINIMUM_TO_BE_POPULAR = 3;
var SHOW_UNPOPULAR = setInterval(function() {
jQuery('.post:visible').each(function() {
var notescount = jQuery(this).find('span.post_notes').data('notes');
if (notescount >= MINIMUM_TO_BE_POPULAR) {
jQuery(this).hide();
}
});
}, 1500);
// this will undo this change
// but probably easier just to reload the page
clearInterval(SHOW_UNPOPULAR)
jQuery('.post').show();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment