Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Commit

Permalink
Added a new event for delete messages. Upped version and updated the …
Browse files Browse the repository at this point in the history
…year on the license
  • Loading branch information
ollieparsley committed Feb 23, 2012
1 parent 5f04ba6 commit 851d061
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,4 +1,4 @@
Copyright (c) 2011 MediaSift Ltd
Copyright (c) 2012 MediaSift Ltd

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
12 changes: 11 additions & 1 deletion datasift.js
Expand Up @@ -270,14 +270,24 @@ DataSift.prototype.unsubscribe = function(hash) {
* @return void
*/
DataSift.prototype.receivedData = function(json) {
//Check to see if its an error
//Check for errors
if (json.status == "failure") {
this.errorCallback(new Error(json.message));
this.disconnect(true);

//Check for warnings
} else if (json.status == "warning") {
this.emit('warning', json.message);

//Check for deletes
} else if (json.data !== undefined && json.data.deleted === true) {
this.emit('delete', json);

//Check for ticks
} else if (json.tick !== undefined) {
this.emit('tick', json);

//Normal interaction
} else {
this.emit('interaction', json);

Expand Down
6 changes: 3 additions & 3 deletions package.json
@@ -1,13 +1,13 @@
{
"name": "datasift",
"version": "0.1.2",
"version": "0.1.3",
"description": "DataSift streaming API consumer",
"main": "datasift.js",
"keywords": [
"datasift",
"twitter",
"facebook",
"streaming"
"facebook",
"streaming"
],
"repository": {
"type": "git",
Expand Down

0 comments on commit 851d061

Please sign in to comment.