Posted By

LeMilonkh on 10/16/10


Tagged

notify favicon twitter


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

LeMilonkh
Tyster
verostudios


TwitNotifyFavicon


 / Published in: jQuery
 

  1. // TwitFaviconNotify
  2. // (c) 2010 by @LeMilonkh (Milan Gruner)
  3.  
  4. var old_favicon = "";
  5.  
  6. function checkTweets() {
  7. var favicon = $('head link[rel$=icon]');
  8.  
  9. if($('.new-tweets-bar').length > 0) {
  10. if(old_favicon == "")
  11. old_favicon = favicon.attr('href');
  12. favicon.replaceWith('');
  13. $('head').append($('<link rel="shortcut icon" type="image/x-icon"/>').attr('href', 'http://www.favicon.cc/favicon/785/260/favicon.png'));
  14. }
  15. else if(favicon.attr('href') != old_favicon) {
  16. favicon.replaceWith('');
  17. $('head').append($('<link rel="shortcut icon" type="image/x-icon"/>').attr('href', old_favicon));
  18. }
  19. }
  20.  
  21. $(document).ready(function() {
  22. window.setInterval(checkTweets,10000);
  23. });

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: LeMilonkh on October 16, 2010

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

You need to login to post a comment.