Skip to content

Instantly share code, notes, and snippets.

@swapagarwal
Created October 6, 2013 08:34
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 swapagarwal/6851210 to your computer and use it in GitHub Desktop.
Save swapagarwal/6851210 to your computer and use it in GitHub Desktop.
Installation Link : http://userscripts.org/scripts/show/179316 Kills the news feed and replaces it with a message reminding you not to get distracted. That's it. You can still check your messages and notifications, post status updates, and do everything you could do before. You just won't get distracting news feed posts anymore. No more wasting …
// ==UserScript==
// @name HideFacebookNewsFeed
// @description Saves you time by hiding Facebook news feed.
// @include *://*.facebook.com/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js
// ==/UserScript==
/*
* Author : Swapnil Agarwal
*/
function blockAndDisplay() {
var feed = $('[id^=topnews_main_stream], [id^=mostrecent_main_stream], [id^=pagelet_home_stream]');
var message = $('#distracted');
if (feed.length == 0) {
message.remove();
} else if (message.length == 0) {
message = $('<h1>')
.attr('id', 'distracted')
.text("Don't get distracted by Facebook!")
.css('font-size', '30px')
.css('font-family', "'Helvetica Neue', Helvetica, Arial, 'lucida grande', tahoma, verdana, arial, sans-serif")
.css('position', 'relative')
.css('top', '75px');
$('[data-location=maincolumn]').append(message);
}
feed.children().remove();
$('.ticker_stream').remove();
}
function repeatFunction(func, delay) {
func();
setTimeout(function() {
repeatFunction(func, delay);
}, delay);
}
repeatFunction(blockAndDisplay, 100);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment