1.0.5 • Published 7 years ago

theroom v1.0.5

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

theRoom service bridge

Install

$ npm install theroom

Usage

var TheRoom  	= require('theroom').theRoom;

var config = {
	"serverURL":"http://e-nodehost.ru:1337",
	"applicationId":"myAppId",
	"roomId":"s18LmTlmA8",
	"proxy":"http://userId:password@172.31.55.70:9090"
};

var theRoom 	= new TheRoom(config);

var mdcontent = '#chart test\r\n\
\r\n\
~[discreteBarChart:{title:"test",xlabel:"sdkjf",ylabel:"sfdjsdhf",data:[12.2,34,234,234,324,53,45,65,645,45,45,23,44,54]}]~';

theRoom.login("Robo1","Robo1", function (err){

	if (err) {
		console.log ("error", err);
		return;
	}

	theRoom.joinRoom(config.roomId,function(err){

		if (err){
			console.log ("Server error:", err);
			return;
		}

		theRoom.registerAction("test1", { action:"chatMessage",	params:[undefined,'test message'], users:undefined,	title:"test3", description:"test 3 test 3 test 3" }, 
			function(){
				console.log ("call back of registerAction");
		});

		try{
			if (!err){
				setTimeout(function(){
					console.log ("send msg");

					theRoom.sendMessage(config.roomId, {
						content:{
							options: mdcontent
						}
					});
				},1000);
			}
		}
		catch(ex){
			console.log (ex);
		}
	});
	
})

theRoom.on("chatMessage", function(ev,data){
	console.log (ev,data);
});

License

MIT © Sindre Sorhus

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago