From f313d5f602a85dc3b51bd53f381f5d1a3476779e Mon Sep 17 00:00:00 2001 From: Drew Wells Date: Sun, 23 Feb 2014 08:02:46 -0600 Subject: [PATCH 1/3] package.json --- data/package.json | 15 --------------- package.json | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 15 deletions(-) delete mode 100644 data/package.json create mode 100644 package.json diff --git a/data/package.json b/data/package.json deleted file mode 100644 index 0b9973b..0000000 --- a/data/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "portify", - "description": "Moves your Spotify playlists to Google", - "version": "0.0.5", - "private": true, - "dependencies": { - "googleclientlogin": "*", - "spotify-web": "https://github.com/mauimauer/node-spotify-web/tarball/master", - "socket.io": "*", - "express": "*", - "superagent": "*", - "levenshtein": "*", - "timequeue": "*" - } -} \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..d54f17b --- /dev/null +++ b/package.json @@ -0,0 +1,15 @@ +{ + "name": "portify", + "description": "Moves your Spotify playlists to Google", + "version": "0.0.6", + "private": true, + "dependencies": { + "spotify-web": "https://github.com/mauimauer/node-spotify-web/tarball/master", + "socket.io": "~0.9.16", + "express": "~3.4.8", + "superagent": "~0.16.0", + "levenshtein": "~1.0.4", + "timequeue": "~0.2.2", + "googleapis": "~0.6.1" + } +} From 31695a012f3a4e11645088e111e735bc9b1afb8d Mon Sep 17 00:00:00 2001 From: Drew Wells Date: Sun, 23 Feb 2014 09:48:14 -0600 Subject: [PATCH 2/3] Enable `npm start` Dynamically find version of package.json Update readme for new installation/run instructions --- .gitignore | 2 ++ README.md | 4 ++-- data/app.js | 15 +++++++++------ server.js | 1 + 4 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 .gitignore create mode 100644 server.js diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ed42d01 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules +npm_debug.log diff --git a/README.md b/README.md index d22badd..74c7a32 100644 --- a/README.md +++ b/README.md @@ -22,8 +22,8 @@ Building portify * Make sure you have installed a usable build enviroment (gcc, make & co.) * Install Node.js (using your favourite package manager, but make sure it's newer than 0.8) * Clone the git repo (master branch) -* Go into the ./data/ directory and run npm install (This will fetch and compile all depenencies of portify) -* Try running the daemon by executing node app.js in the ./data/ folder +* `npm install` Install dependencies +* `npm start` Start the server * Open your favourite browser and go to localhost:3132 [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/mauimauer/portify/trend.png)](https://bitdeli.com/free "Bitdeli Badge") diff --git a/data/app.js b/data/app.js index 1543868..d6075c0 100644 --- a/data/app.js +++ b/data/app.js @@ -12,13 +12,14 @@ var app, io = require('socket.io'), TimeQueue = require('timequeue'); -console.log("portify 0.51"); +console.log("portify, version: " + process.env.npm_package_version); + if (typeof Proxy !== 'object' || typeof WeakMap !== 'function') { console.log("Starting without harmony"); express = require('express'); postField = "body"; app = express(); - server = http.createServer(app) + server = http.createServer(app); router = app; app.use(express.static(__dirname + '/content')); app.use (function(req, res, next) { @@ -276,7 +277,7 @@ router.post('/spotify/login', function(request, response, next){ response.send({ status: 400, message: "login failed.", error: err }); return; } - + console.log("Spotify Login success"); spotifySession = spotify; response.send({ status: 200, message: "login successful." }); @@ -448,8 +449,10 @@ if(appjs) { window.process = process; window.module = module; - function F12(e){ return e.keyIdentifier === 'F12' } - function Command_Option_J(e){ return e.keyCode === 74 && e.metaKey && e.altKey } + function F12(e){ return e.keyIdentifier === 'F12'; } + function Command_Option_J(e){ + return e.keyCode === 74 && e.metaKey && e.altKey; + } window.addEventListener('keydown', function(e){ if (F12(e) || Command_Option_J(e)) { @@ -461,4 +464,4 @@ if(appjs) { window.on('close', function(){ console.log("Window Closed"); }); -} \ No newline at end of file +} diff --git a/server.js b/server.js new file mode 100644 index 0000000..6e55ba7 --- /dev/null +++ b/server.js @@ -0,0 +1 @@ +require('./data/app') From 184a457e7cfefc5dbf5a6dd5c5e3f3889408af30 Mon Sep 17 00:00:00 2001 From: Drew Wells Date: Sun, 23 Feb 2014 09:49:48 -0600 Subject: [PATCH 3/3] Switch to api-redesign --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d54f17b..8464f3c 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "version": "0.0.6", "private": true, "dependencies": { - "spotify-web": "https://github.com/mauimauer/node-spotify-web/tarball/master", + "spotify-web": "https://github.com/adammw/node-spotify-web/tarball/api-redesign/", "socket.io": "~0.9.16", "express": "~3.4.8", "superagent": "~0.16.0",