I really hate facebook

They’re everywhere. I hate the logo and everything that goes with it, the cookies, the scripts, the tracking etc etc. It was nice in the beginning but they’re out of control.

What to do….what to do.

Block them and do it creatively. There are LOTS of solutions for blocking them and their scripts and cookies.

My approach is to modify my hosts file and redirect as many of their domains as I can to the trash bin.

GREAT IDEA! But I wanted more. I wanted to be able to track how many times and what pages were getting data/sending data to them. Plus I wanted some simple indication that they had been blocked. Here’s what I did.

I setup a spot on my web server to accept the “redirects”. http://www.jeffw.net/nofb/index.html

If you go there you’ll get a page of little 21×21 pictures of a “No Facebook” icon. Cool!

The 21×21 pixel icon fits neatly where a news page might have a link out to facebook- thus you can see where in the page facebook got blocked.

My web logs also keep track of what pages/URLs were requested so I have some idea of where all these redirects were trying to go.

This is what I added to my hosts file in Windows 7:

54.243.181.94 www.facebook.com facebook.com static.ak.fbcdn.net 
54.243.181.94 www.static.ak.fbcdn.net login.facebook.com 
54.243.181.94 www.login.facebook.com fbcdn.net www.fbcdn.net 
54.243.181.94 fbcdn.com www.fbcdn.com static.ak.connect.facebook.com 
54.243.181.94 www.static.ak.connect.facebook.com
54.243.181.94 facebook.net www.facebook.net connect.facebook.net
54.243.181.94 m.facebook.net m.facebook.com

All those domains are now redirected to my server which happily accepts the connection, logs it and gives you a nice big page of “No Facebook” images.

99% of the time you’ll only see a few of the images because that’s all the space a web page will allocate to their “like” section. Good enough. If you see the little image you know it worked.

Now if you don’t want to send your redirects to me so I can collect data about what pages facebook is sending you to, you can easily replace my ip address with 127.0.0.1 which will redirect the links to your local computer. Since you probably don’t have a web server running you’ll get blank spaces instead of my little images.

I’ll update the hosts file entries as I find more that need to be blocked.

Enjoy!

 

 

 

 

Advertisements

Author: Helicopter Jeff

I'm a vinyl decal cutting and designing, Astrophotography and general photography capturing, RC helicopter/quad copter pilot, Arduino and Raspberry Pi hardware/software developer, network, scripting and troubleshooting ninja living in the metro NY area. I am passionate about my hobbies so much I do them for a living. There's nothing better than getting paid to do what you love.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s