// ==UserScript== // @name 汤不热首页只显示视频博客(Tumblr display only video on dashboard) // @namespace http://tampermonkey.net/ // @version 0.1 // @description 首页只显示视频博客(Photos will not display on dashboard) // @author Frank // @match https://www.tumblr.com/dashboard // @grant none // @downloadURL none // ==/UserScript== var $ = window.jQuery; var liAmount = 0; var dataType = ['photo', 'photoset', 'regular', 'note', 'link']; $(document).ready(function(){ hidePhotoDiv(); showVpnTutorial(); $(window).scroll(function(event){ var newLiAmount = $( "#posts li.post_container" ).length; if (newLiAmount > liAmount) { hidePhotoDiv(); liAmount = newLiAmount; } }); }); function hidePhotoDiv() { $( "#posts li.post_container div.post_full" ).each(function( index, element ) { if (index > 0){ var dataType = $(this).attr('data-type'); var isRecommend = $(this).attr('data-is_recommended'); if (dataType !== 'video' || isRecommend === '1') { $(this).parent().remove(); } } }); } function showVpnTutorial() { var firstBlog = $( "#posts li.post_container:eq(1) div.post_content_inner"); var comment = firstBlog.find("p"); if(comment.length === 0) { firstBlog.append('
'); } else { $(comment[0]).html('一键安装VPN教程'); } }