Facebook Highlight Birthdays

By Jordon Kalilich Last update Oct 24, 2009 — Installed 11,694 times. Daily Installs: 17, 18, 16, 23, 14, 24, 20, 13, 26, 12, 12, 13, 16, 25, 19, 65, 536, 194, 143, 69, 119, 171, 52, 47, 46, 53, 41, 36, 33, 36, 41, 31

There are 3 previous versions of this script.

// ==UserScript==
// @name          Facebook Highlight Birthdays
// @version       11
// @date          2009-10-24
// @description   Highlights today's birthdays on your home page.
// @namespace     http://www.theworldofstuff.com/greasemonkey/
// @copyright     Copyright 2007-2009 Jordon Kalilich (http://www.theworldofstuff.com/)
// @license       GNU GPL version 3 or later; http://www.gnu.org/copyleft/gpl.html
// @require       http://usocheckup.dune.net/12813.js?maxage=5
// @include       http*://*.facebook.com/home.php*
// ==/UserScript==

// options
var highlightColor = '#fffe88';
var today = 'today'; // the word "today" in your language (case-insensitive if your language does the whole cases thing)

// the actual code
var birthdayRegex = new RegExp("ref=hpbday.+>\s*" + today + "\s*<\/span>\s*$", "i");
var birthdays = document.evaluate("//div[@class='UIUpcoming_Item']", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
for (i = birthdays.snapshotLength - 1; i >= 0; i--) {
   if (birthdayRegex.test(birthdays.snapshotItem(i).innerHTML)) {
      birthdays.snapshotItem(i).setAttribute('style','font-weight: bold; background: ' + highlightColor);
   }
}