Last active
September 30, 2015 13:22
-
-
Save artlung/942b8479f7a84214449f to your computer and use it in GitHub Desktop.
show unpopular posts on a tumblr users archive page
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
// 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 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
// 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