Facebook Highlight Birthdays

By Jordon Kalilich Last update Nov 17, 2009 — Installed 13,087 times. Daily Installs: 143, 69, 119, 171, 52, 47, 46, 53, 41, 36, 33, 36, 41, 31, 25, 35, 38, 34, 17, 28, 26, 34, 125, 212, 160, 140, 140, 127, 86, 59, 60, 43

There are 4 previous versions of this script.

// ==UserScript==
// @name          Facebook Highlight Birthdays
// @version       12
// @date          2009-11-17
// @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/
// @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);
   }
}