Update README; add LICENSE
This commit is contained in:
parent
68fc74edd5
commit
e902a8074a
BIN
.header.js.swp
Normal file
BIN
.header.js.swp
Normal file
Binary file not shown.
BIN
.server.js.swp
Normal file
BIN
.server.js.swp
Normal file
Binary file not shown.
54
README.md
54
README.md
|
@ -1,4 +1,52 @@
|
||||||
I promise to actually document this at some point.
|
calzoneman/sync
|
||||||
|
===============
|
||||||
|
|
||||||
If you want to try it, edit settings in config.js and update
|
About
|
||||||
`IO_URL` in www/assets/js/client.js
|
-----
|
||||||
|
|
||||||
|
Sync is a server/client combination I wrote to synchronize media playback
|
||||||
|
among clients. It's inspired by Synchtube, but I wanted to make the
|
||||||
|
interface simpler, add a searchable library for each channel, and it's just
|
||||||
|
a fun challenge.
|
||||||
|
|
||||||
|
The serverside is written in JavaScript and runs on Node.JS. It makes use
|
||||||
|
of a MySQL database to store user registrations, cached media metadata, and
|
||||||
|
data about each channel.
|
||||||
|
|
||||||
|
The clientside is written in JavaScript and makes use of Socket.IO and
|
||||||
|
jQuery. The web interface uses Bootstrap for layout and styling.
|
||||||
|
|
||||||
|
Sync currently supports YouTube, Soundcloud, Vimeo, and TwitchTV.
|
||||||
|
|
||||||
|
Installing
|
||||||
|
----------
|
||||||
|
|
||||||
|
This assumes you have Node.JS installed.
|
||||||
|
I'm using v0.8.20, please feel free to report which versions do/do not work
|
||||||
|
|
||||||
|
1. Clone this repository
|
||||||
|
2. `cd` to the directory containing the source files
|
||||||
|
3. Install socket.io: `npm install socket.io`
|
||||||
|
4. Install connect: `npm install connect`
|
||||||
|
5. Install your distribution's `libmysqlclient` package
|
||||||
|
6. Install the libmysql node module: `npm install mysql-libmysqlclient`
|
||||||
|
7. Edit `config.js` and input your database details and connection port
|
||||||
|
8. Edit `www/assets/js/client.js` and change the value of `IO_URL` to `yourhostname:port` where `port` is the port defined in `config.js`
|
||||||
|
|
||||||
|
Running
|
||||||
|
-------
|
||||||
|
|
||||||
|
Start the server: `node server.js`
|
||||||
|
You should now be able to connect via `yourhostname:port` where `port` is
|
||||||
|
the port you defined in config.js
|
||||||
|
|
||||||
|
Feedback
|
||||||
|
--------
|
||||||
|
|
||||||
|
Please open a GitHub Issue.
|
||||||
|
|
||||||
|
License
|
||||||
|
-------
|
||||||
|
|
||||||
|
[Licensed under Creative Commons Attribution-NonCommercial 3.0](http://creativecommons.org/licenses/by-nc/3.0/)
|
||||||
|
See LICENSE for the full license text
|
||||||
|
|
8
auth.js
8
auth.js
|
@ -1,3 +1,11 @@
|
||||||
|
/**
|
||||||
|
* Copyright 2013 Calvin 'calzoneman' Montgomery
|
||||||
|
*
|
||||||
|
* Licensed under Creative Commons Attribution-NonCommercial 3.0
|
||||||
|
* See http://creativecommons.org/licenses/by-nc/3.0/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
var mysql = require('mysql-libmysqlclient');
|
var mysql = require('mysql-libmysqlclient');
|
||||||
var Config = require('./config.js');
|
var Config = require('./config.js');
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
/**
|
||||||
|
* Copyright 2013 Calvin 'calzoneman' Montgomery
|
||||||
|
*
|
||||||
|
* Licensed under Creative Commons Attribution-NonCommercial 3.0
|
||||||
|
* See http://creativecommons.org/licenses/by-nc/3.0/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
var mysql = require('mysql-libmysqlclient');
|
var mysql = require('mysql-libmysqlclient');
|
||||||
var Config = require('./config.js');
|
var Config = require('./config.js');
|
||||||
var Rank = require('./rank.js');
|
var Rank = require('./rank.js');
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
/**
|
||||||
|
* Copyright 2013 Calvin 'calzoneman' Montgomery
|
||||||
|
*
|
||||||
|
* Licensed under Creative Commons Attribution-NonCommercial 3.0
|
||||||
|
* See http://creativecommons.org/licenses/by-nc/3.0/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
exports.MYSQL_SERVER = '';
|
exports.MYSQL_SERVER = '';
|
||||||
exports.MYSQL_DB = '';
|
exports.MYSQL_DB = '';
|
||||||
exports.MYSQL_USER = '';
|
exports.MYSQL_USER = '';
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
/**
|
||||||
|
* Copyright 2013 Calvin 'calzoneman' Montgomery
|
||||||
|
*
|
||||||
|
* Licensed under Creative Commons Attribution-NonCommercial 3.0
|
||||||
|
* See http://creativecommons.org/licenses/by-nc/3.0/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
var http = require('http');
|
var http = require('http');
|
||||||
|
|
||||||
// Helper function for making an HTTP request and getting the result
|
// Helper function for making an HTTP request and getting the result
|
||||||
|
|
8
media.js
8
media.js
|
@ -1,3 +1,11 @@
|
||||||
|
/**
|
||||||
|
* Copyright 2013 Calvin 'calzoneman' Montgomery
|
||||||
|
*
|
||||||
|
* Licensed under Creative Commons Attribution-NonCommercial 3.0
|
||||||
|
* See http://creativecommons.org/licenses/by-nc/3.0/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
// Helper function for formatting a time value in seconds
|
// Helper function for formatting a time value in seconds
|
||||||
// to the format hh:mm:ss
|
// to the format hh:mm:ss
|
||||||
function formatTime(sec) {
|
function formatTime(sec) {
|
||||||
|
|
8
rank.js
8
rank.js
|
@ -1,3 +1,11 @@
|
||||||
|
/**
|
||||||
|
* Copyright 2013 Calvin 'calzoneman' Montgomery
|
||||||
|
*
|
||||||
|
* Licensed under Creative Commons Attribution-NonCommercial 3.0
|
||||||
|
* See http://creativecommons.org/licenses/by-nc/3.0/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
exports.Guest = 0;
|
exports.Guest = 0;
|
||||||
exports.Member = 1;
|
exports.Member = 1;
|
||||||
exports.Moderator = 4;
|
exports.Moderator = 4;
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
/**
|
||||||
|
* Copyright 2013 Calvin 'calzoneman' Montgomery
|
||||||
|
*
|
||||||
|
* Licensed under Creative Commons Attribution-NonCommercial 3.0
|
||||||
|
* See http://creativecommons.org/licenses/by-nc/3.0/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
var User = require('./user.js').User;
|
var User = require('./user.js').User;
|
||||||
var Config = require('./config.js');
|
var Config = require('./config.js');
|
||||||
var connect = require('connect');
|
var connect = require('connect');
|
||||||
|
|
8
user.js
8
user.js
|
@ -1,3 +1,11 @@
|
||||||
|
/**
|
||||||
|
* Copyright 2013 Calvin 'calzoneman' Montgomery
|
||||||
|
*
|
||||||
|
* Licensed under Creative Commons Attribution-NonCommercial 3.0
|
||||||
|
* See http://creativecommons.org/licenses/by-nc/3.0/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
var Rank = require('./rank.js');
|
var Rank = require('./rank.js');
|
||||||
var Auth = require('./auth.js');
|
var Auth = require('./auth.js');
|
||||||
var Channel = require('./channel.js').Channel;
|
var Channel = require('./channel.js').Channel;
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
/**
|
||||||
|
* Copyright 2013 Calvin 'calzoneman' Montgomery
|
||||||
|
*
|
||||||
|
* Licensed under Creative Commons Attribution-NonCommercial 3.0
|
||||||
|
* See http://creativecommons.org/licenses/by-nc/3.0/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
// Wrapped in a function so I can ensure that the socket
|
// Wrapped in a function so I can ensure that the socket
|
||||||
// is defined before these statements are run
|
// is defined before these statements are run
|
||||||
function initCallbacks() {
|
function initCallbacks() {
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
/**
|
||||||
|
* Copyright 2013 Calvin 'calzoneman' Montgomery
|
||||||
|
*
|
||||||
|
* Licensed under Creative Commons Attribution-NonCommercial 3.0
|
||||||
|
* See http://creativecommons.org/licenses/by-nc/3.0/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
const IO_URL = "http://somewebsite:1337";
|
const IO_URL = "http://somewebsite:1337";
|
||||||
const SYNC_THRESHOLD = 2;
|
const SYNC_THRESHOLD = 2;
|
||||||
var LEADER = false;
|
var LEADER = false;
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
/**
|
||||||
|
* Copyright 2013 Calvin 'calzoneman' Montgomery
|
||||||
|
*
|
||||||
|
* Licensed under Creative Commons Attribution-NonCommercial 3.0
|
||||||
|
* See http://creativecommons.org/licenses/by-nc/3.0/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
// Adds a user to the chatbox userlist
|
// Adds a user to the chatbox userlist
|
||||||
function addUser(name, rank, leader) {
|
function addUser(name, rank, leader) {
|
||||||
var div = document.createElement('div');
|
var div = document.createElement('div');
|
||||||
|
|
Loading…
Reference in a new issue