DevFeed is a communications server for developers that allows message sharing in real time.
- JSON/Resty API.
- Simple
- History support (e.g. get all messages since );
-
On success:
{ success: true, result: { data: data } } -
On failure:
{ success: false, result: "Message about the failure." } -
successtells you whether or not your request was successful. -
If
successis true, thenresultcontains the data you were asking for. and theresultwill always be an object. -
If
successis false, thenresultcontains an error message, andresultwill always be a string.
- Usage: To post a message to the chat.
- POST only.
- Expecting an object that looks like this in the post body:
{
nick: "name"
, message: "Message goes here."
}nickis the name that the user wishes to post under.messageis the message that the user wishes to post.- Example:
eric@russia:~ $ curl -X POST localhost:9001/send \
-H 'Content-type: application/json' \
-d '{"nick": "eric", "message": "Iam a bus!" }' { "success": true, "result": { "saved": true, "timestamp": 1330073393938 }}-
Usage: To get messages from the chat room.
-
GET only.
-
:timestampneeds to be replaced with a timestamp sometime in the past. The timestamp represents how far back you would like messages from. For example, if the current time was1330071170397, a:timestampof1330071110397would get all messages posted in the last minute.You could also post a
:timestampof 0 to get all messages ever posted in the room. -
Example:
eric@russia:~ $ curl -s localhost:9001/update/since/0 | python -m json.tool {
"result": {
"1329941180485": {
"message": "Hello there.",
"nick": "eric",
"timestamp": 1329941180485,
"type": "message"
},
"1330073393938": {
"message": "Iam a bus!",
"nick": "eric",
"timestamp": 1330073393938,
"type": "message"
}
},
"success": true
} -
Usage: To get messages from the chat room that happened during previous
:secondsamount of seconds. -
GET only.
-
:secondsneeds to be replaced with a positive integer value which indicates the maximum age in seconds of the posts that will be returned. -
Success looks like this:
eric@russia:~ $ curl -s localhost:9001/update/last/1500 | python -m json.tool {
"result": {
"1330073393938": {
"message": "Iam a bus!",
"nick": "eric",
"timestamp": 1330073393938,
"type": "message"
},
},
"success": true
}- Usage: To get the server's current time.
- GET only.
- This is useful to calculate the offset between the client's time and the
server time. Because all requests for
/update/:timestampare based on the server time, the offset is useful. - Example:
eric@russia:~ $ curl -s localhost:9001/server/time | python -m json.tool {
"result": {
"serverTime": 1330074623482
},
"success": true
}