Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Userscript for Fluid apps (assumes window.fluid, so probably won't work with Greasemonkey)
// ==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