Created
June 28, 2011 15:01
-
-
Save jboonstra/1051327 to your computer and use it in GitHub Desktop.
Userscript for Fluid apps (assumes window.fluid, so probably won't work with Greasemonkey)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name Turntable Growl Notifier | |
| // @namespace http://joel.boonstras.com/ | |
| // @include http://turntable.fm/* | |
| // @author Joel Boonstra | |
| // ==/UserScript== | |
| // | |
| // Adapted from https://github.com/kyanny/turntablefm-growl-notify by | |
| // http://twitter.com/kyanny | |
| (function(){ | |
| var $ = window.$; | |
| var count = 0; | |
| var room; | |
| // the main loop that checks for new songs | |
| setInterval(function () { | |
| room = $('#top-panel .room .name').text(); | |
| var $messages = $('.message'); | |
| if ($messages.length > count){ | |
| growl(room, $messages.last().text()); | |
| } | |
| count = $messages.length; | |
| }, 1000); | |
| function growl(title, message) { | |
| window.fluid.showGrowlNotification({ | |
| title: title, description: message | |
| }); | |
| } | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment