Twitter Deletes

Updated on Friday, 14 December, 2012 - 15:57

Twitter sends us a notification whenever one of their users deletes a Tweet. We pass these notifications on to you as part of your stream. If you are storing Tweets you must take account of all of these delete messages in order to comply with Twitter's Terms of Service.

If you are a Twitter user with a private account, DataSift never receives your Tweets. Information from private accounts is not released by Twitter so there are no delete messages from these accounts either.

When a user deletes a Tweet, we automatically remove it from our database, so it is no longer available on our Historics service.

We recommend that you read the Data Privacy FAQ.

Example

Here's an example of a delete message in JSON format.

 

Your responsibilities when writing client code

Your client code must process all delete messages, removing the corresponding Tweet. You must discard the delete message itself; you are not permitted to store any delete messages and you must not create a service that publicizes delete messages.

DataSift's output stream contains a series of objects, but those objects do not all represent data. Some of them are 'ticks' which indicate that the connection is open but has not received any data for several seconds. Some are delete messages. If you write your own client code or client libraries, remember that they must be able to recognize and handle delete messages.

Our own client libraries provide support for delete messages. In your chosen client library, look for an on_deleted event handler and add code to locate and delete the corresponding Tweet.

 

DataSift Caching

DataSift maintains a cache of data from the past five days, allowing us to map any Twitter id found in a Twitter delete request to a DataSift interaction id. If a Twitter user deletes a Tweet within five pays of posting it, DataSift looks up the corresponding interaction id, generates a delete message for you, and sends it out in your stream.

For Tweets deleted more than five days after posting, we attempt to match the Twitter user_id to the CSDL in your streams. If we find a match, we will send a delete message containing as much relevant information as we have.