/ Published in: jQuery
Expand |
Embed | Plain Text
// TwitFaviconNotify // (c) 2010 by @LeMilonkh (Milan Gruner) var old_favicon = ""; function checkTweets() { var favicon = $('head link[rel$=icon]'); if($('.new-tweets-bar').length > 0) { if(old_favicon == "") old_favicon = favicon.attr('href'); favicon.replaceWith(''); $('head').append($('<link rel="shortcut icon" type="image/x-icon"/>').attr('href', 'http://www.favicon.cc/favicon/785/260/favicon.png')); } else if(favicon.attr('href') != old_favicon) { favicon.replaceWith(''); $('head').append($('<link rel="shortcut icon" type="image/x-icon"/>').attr('href', old_favicon)); } } $(document).ready(function() { window.setInterval(checkTweets,10000); });
Comments
Subscribe to comments
You need to login to post a comment.

I've got a problem, don't know how to solve it: This script changes the twitter favicon into red if a new tweet arrives but wont change back if the user has read it...
Thanks, LeMilonkh