Git Product home page Git Product logo

socketchat's Introduction

Table of Contents

SocketChat

WebSocket+MongoDB Chat

version

0.3.0

required

  • Socket.IO
  • node-mongodb-native
  • express

event formats

->events.txt

log formats

  {
    name: "String",
    time: ISODate,
    ip  : "String",
    comment: CommentObject,
    (syslog: true),
  }

CommentObject

one of:

  • "String"
  • [CommentObject,]

on-browser JavaScript API

  //Global variable: factory
  factory.getChat(function(chat){
    chat.api.on("log",function(log){
      chat.api.inout("Alice");
      chat.api.say("foo",log._id,"bar");	//comment, response, channel
    });
  });

API formats

最初のリクエストでsessionIdを取得した後は、そのsessionIdをリクエストに加えること(sessionId=(String))

定期的なリクエスト

GET: /api/

入退室

GET: /api/inout?name=(String)

発言

GET: /api/say?comment=(String)

レスポンス

通常時


Userinfo
ユーザー一覧を完全に取得

 {"name": "users",
  "users": {
            "users": [Userobj, Userobj, ...],
            "roms":25,	//ROM数
            "actives":1,//入室者数
           }
 }

新しいユーザーが出現


既存のユーザーが入退室

 {"name": "inout",
  "user": {
           "rom": false, //ROMかどうか
           "id": 3,	 //ユーザーのID
           "name": String, //ユーザーの名前
          }
 }

ユーザーが消滅

 {"name":"deluser",
  "id": Id	//ユーザーのID
 }

エラー時


Hashtag validation

  • スペースを含まない
  • #を含まない
  • スラッシュで始まらない
  • スラッシュで終わらない
  • スラッシュが連続しない

socketchat's People

Contributors

dque avatar na2hiro avatar tatamo avatar uhyo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.