Last active
December 20, 2015 12:58
-
-
Save nitinthewiz/6134794 to your computer and use it in GitHub Desktop.
TamperMonkey script to stop Buffer, IFTTT, PourOver, Twitterfeed and dlvrit posts from showing up in treeview. Install Tampermonkey in Chrome or Greasemonkey in FF (not tested, should work) and then add this script.
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
// ==UserScript== | |
// @name Treeview cleanse | |
// @version 0.1.4 | |
// @namespace http://blog.nitinkhanna.com | |
// @author nitinkhanna | |
// @run-at document-end | |
// @include *treeview* | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js | |
// ==/UserScript== | |
// GM_log("run!"); | |
var rrr = function() { | |
//try { | |
//GM_log("jQuery().jquery: " + jQuery().jquery); | |
//} catch (e) { | |
//console.log(e); | |
//} | |
window.setTimeout(rrr, 2000); | |
var divs = document.getElementsByClassName('post-container'); | |
$(divs).each(function() { | |
singlepost = $(this); | |
try{ | |
if(singlepost.attr('data-user-locale')=='ja_JP'){ | |
singlepost.hide(); | |
} | |
singlepost.find('a').each(function() { | |
var text = $(this).text(); | |
//console.log($(this)); | |
if(text == 'IFTTT' || text == 'Buffer' || text == 'PourOver' || text == 'twitterfeed' || text == 'Zapier' || text == 'Scoop.it' | |
|| text == 'dlvrit' || text == 'PourOver' || text == 'Posts to ADN' || text == 'Instapaper' | |
|| text == 'FeedPress Publisher' || text == 'RlsArchive' || text == 'LinksAlpha' || text == 'NewsurViews' || text == 'SocialOomph.com' | |
|| text == 'CineBuzer' || text == 'review4x' || text == 'hdmaza' | |
|| text == 'AamJanata Updates' || text == 'News Harvester' | |
|| text == 'Political Rift' || text == 'Gizmag Articles' || text == 'DigitalForex' | |
|| text == 'vergratiso' || text == 'MusicNews' || text == 'SNAP' || text == 'selfpic' | |
|| text == 'CafeFilm'){ | |
// AamJanata Updates | |
singlepost.hide(); | |
//console.log("we just hid: " + $(this)); | |
} | |
}); | |
singlepost.find('span').each(function() { | |
var text = $(this).text(); | |
//console.log($(this)); | |
if(text.indexOf("onlywire.com") != -1 || text.indexOf("has been published on") != -1 ){ | |
singlepost.hide(); | |
//console.log("we just hid: " + $(this)); | |
} | |
}); | |
}catch(e){ | |
console.log("Something wrong"); | |
} | |
}); | |
//console.log("the end"); | |
//GM_log(jQuery().jquery); | |
//$(document).ready(function($){ | |
//}); | |
}; | |
rrr(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment