Samuel Liew’s Blog

News, events, and other interesting finds

Do you have too many friends on facebook that you don’t know? Now you can remove them simply by visiting their profiles. I wrote a Greasemonkey script that will help you do exactly that, and another that helps you add instead of delete.

What is Greasemonkey?

Greasemonkey allows you to customize the way a webpage displays on Firefox using small bits of JavaScript. Hundreds of scripts, for a wide variety of popular sites, are already available at http://userscripts.org.
- http://addons.mozilla.org/en-US/firefox/addon/748

Greasemonkey is a Mozilla Firefox add-on that allows users to install scripts that make on-the-fly changes to HTML web page content on the DOMContentLoaded event, which happens immediately after it is loaded in the browser (also known as augmented browsing). As Greasemonkey scripts are persistent, the changes made to the web pages are executed every time the page is opened, making them effectively permanent for the user running the script.
- http://en.wikipedia.org/wiki/Greasemonkey

Where to get Greasemonkey?

http://addons.mozilla.org/en-US/firefox/addon/748

Get the two scripts!

Script to auto delete friends:
http://userscripts.org/scripts/show/61122

Script to auto add friends:
http://userscripts.org/scripts/show/61660

Warning!
Don’t forget to disable the scripts when you are not using them, or else you will accidentally delete your real friends, or add people you don’t know!!!

Paste this in the browser address bar to select all checkboxes on a page:

javascript:el=document.getElementsByTagName('input');for(i=0;i<el.length;i++){if(el[i].type=="checkbox")el[i].checked=true;}void(0);

Paste this in the browser address bar to un-select all checkboxes on a page:

javascript:el=document.getElementsByTagName('input');for(i=0;i<el.length;i++){if(el[i].type=="checkbox")el[i].checked=false;}void(0);

Note that the above scripts won’t work for pages displayed in a frame (iframe or frameset).

21 Dec: Church Christmas outreach dinner

22 Dec: Dinner at relative’s house

23 Dec: Uploaded lots of pictures to Facebook

24 Dec: Visit Tan family, dinner at Eng family’s house

27 Dec: Birthday celebration at Bubble Tea chalet BBQ

29 Dec: Birthday party with relatives

Tried creating a Facebook app using clearspring.com

http://apps.facebook.com/wordscram/page

Today I programmed a new userscript for IE7Pro so that I can have a direct link to download original images from Photobucket.

http://www.iescripts.org/view-scripts-193p1.htm

  • Added random color background script to website
  • Went out to meet a friend
  • Snapfish photos arrived by mail  :)
  • I played a JavaScript ‘hacking’ game at http://www.hackquest.de

Sometimes, some webpages are cached in the server and may not be showing the latest version. To ensure that the pages you are at is the latest version, paste this into your title bar:

javascript:location.reload(true);void(0);

I’ve created a browser-based JavaScript puzzle.

Try it: http://www.samliew.com/annoying/