Skip to content

Commit

Permalink
small refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
julien51 committed Jan 11, 2012
1 parent fa90a85 commit 96f0af9
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 4 deletions.
7 changes: 5 additions & 2 deletions bin/server
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ app.configure(function(){
app.use(express.static(__dirname + '/../public'));
});

client = new superfeedr(process.env.SUPERFEEDR_LOGIN, process.env.SUPERFEEDR_PASSWORD);
var superfeedr_login = process.env.SUPERFEEDR_LOGIN || '',
superfeedr_password = process.env.SUPERFEEDR_PASSWORD || '';

client = new superfeedr(superfeedr_login, superfeedr_password);
client.on('connected', function() {
console.log("Connected!");
client.subscribe("http://superfeedr.com/track/music", function(err, feed) {
Expand All @@ -35,4 +38,4 @@ io.sockets.on('connection', function (socket) {

app.listen(process.env.PORT);

console.log('socket.io server started on port ' + process.env.PORT);
console.log('socket.io server started on port ' + (process.env.PORT || 8080));
41 changes: 39 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<!-- Socket.io serves its client-side code over this route automatically -->
<script src="/socket.io/socket.io.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css">

<script>
window.onload = function () {
Expand All @@ -21,7 +22,43 @@
</script>
</head>
<body>
<ul id="inbox">
</ul>


<div class="topbar">
<div class="fill">
<div class="container">
<a class="brand" href="#">Project name</a>
<ul class="nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
<form action="" class="pull-right">
<input class="input-small" type="text" placeholder="Username">
<input class="input-small" type="password" placeholder="Password">
<button class="btn" type="submit">Sign in</button>
</form>
</div>
</div>
</div>

<div class="container">

<div class="content">
<div class="page-header">
<h1>Page name <small>Supporting text or tagline</small></h1>
</div>
<div class="row">
<ul id="inbox">
</ul>
</div>
</div>

<footer>
<p>&copy; Company 2011</p>
</footer>

</div> <!-- /container -->

</body>
</html>

0 comments on commit 96f0af9

Please sign in to comment.