Created
July 19, 2011 17:51
-
-
Save eminetto/1093252 to your computer and use it in GitHub Desktop.
sub.html
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
<html> | |
<head> | |
<title>Notifications</title> | |
</head> | |
<body> | |
<center><h2>Notifications</h2></center> | |
<div id="notification"></div> | |
<script src="http://www.google.com/jsapi"></script> | |
<script type="text/javascript"> | |
// Load jQuery | |
google.load("jquery", "1.6"); | |
</script> | |
<script src='http://pubsub.io/pubsub.io.js'></script> | |
<script> | |
var pubsub = pubsubio.connect('localhost:9999'); | |
//assina o hub e filtra para buscar somente as mensagens de nome=events para o user=eminetto | |
pubsub.subscribe({name: 'events', user: 'eminetto'}, function(doc) { | |
$('#notification').prepend('<a href="' + doc.detail + '">' + doc.title + '</a><br>'); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment