summaryrefslogtreecommitdiff
path: root/Documentation.txt
blob: 23772c3bf8dbef5f09018fa8b6039db8ca789db6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
====== API Documentation

==== Connection
URL: http://omegle.com/

== Header (used in all API calls):
 Host: omegle.com
 Content-type: application/x-www-form-urlencoded; charset=utf-8
 Accept: application/json

==== Commands:
== Start a conversation
URL: /start
PARAM: {}

RETURNS: {'id':'ABCDE'}
 ABCDE is a random string to identify the connection

== Poll for events
Note: The omegle sorver is blocking the connection if no event
 occured.

URL: /events
PARAM: {'id':'ABCDE'}

RETURNS: [[TYPE,data...],...]
  EXAMPLE 1: [["typing"], ["gotMessage", "im 22 m finland"]]
  EXAMPLE 2: [["gotMessage", "ok"]]
  EXAMPLE 3: [["typing"]]
  EXAMPLE 4: [["typing"], ["gotMessage", "hi"], ["typing"], ["gotMessage", "asl"]]
  EXAMPLE 5: [["waiting"], ["connected"]]

Return Messagetypes:
  ["typing"]               - Stranger is typing
  ["stoppedTyping"]        - Stranger has stopped typing
  ["gotMessage", "ABCDE"]  - Stranger send "ABCDE"
  ["waiting"]              - ???
  ["connected"]            - ready to send messages
  ["strangerDisconnected"] - Stranger pressed disconnect

== Send Message
URL: /send
PARAM: {'id':'ABCDE', 'msg':'ABCDE'}

RETURNS: win

== Disconnect/Quit Chat
URL: /disconnect
PARAM: {'id':'ABCDE'}

RETURNS: win

== Get user count
URL: /count
PARAM: {}

RETURNS: '1234'
 1234 is the number of users online