Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect Tweet deletion with Twitter Streaming API

The Twitter Streaming API can be used to detect a phrase using the following query: http://stream.twitter.com/1/statuses/filter.json?track=phrase

However, the same query doesn't seem to detect when the tweet is deleted. Is there a way to do that with the API?

Thanks in advance.

like image 505
Aquaboltar Avatar asked May 10 '11 19:05

Aquaboltar


People also ask

How would you verify the deletion of a Tweet from the Twitter application?

You can call https://api.twitter.com/1.1/statuses/lookup.json and pass it a comma-delimited list of 100 tweets, and then compare the return value to your database to see if the tweets you asked for are still available or not.

Can a deleted Tweet be seen?

Twitter itself maintains an archive of all published tweets, even the deleted ones. Normally, it doesn't allow anyone to access this data, but any user can search through their own Twitter history. To download your Twitter archive, open the Twitter homepage and click on More.

What is the difference between Twitter search API and streaming API?

Rate limit rules are completely different No matter how many people log into your site, the app they all log into can only use a single streaming API connection. The search API, on the other hand, allows a separate rate limited bucket of requests for each user who logs into your app.


1 Answers

According to the docs, you're supposed to get deletions in the stream, they should look like this:

{"delete":{"status":{"id":1234,"id_str":"1234","user_id":3,"user_id_str":"3"}}}

UPDATE: I did a few tests to see what was going on. First, I tried the filter URL with a track parameter, just like you are trying, and confirmed the same behavior that you are seeing. Then I tried a URL with a 'follow' setting instead, like so:

http://stream.twitter.com/1/statuses/filter.json\?follow\=1160471

When I try that, I get both tweets and their deletion messages. It's hard to know for certain obviously without asking Twitter, but I wonder if you just don't get deletions at all when using a track parameter, or if it's another issue along those lines.

like image 109
muffinista Avatar answered Nov 08 '22 00:11

muffinista