6

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.

Alex Bitek
  • 6,529
  • 5
  • 47
  • 77
Aquaboltar
  • 251
  • 1
  • 4
  • 10

1 Answers1

4

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.

muffinista
  • 6,676
  • 2
  • 30
  • 23
  • Read the same docs but unfortunately it doesn't work with the stream syntax I provided. Thinking maybe I'm not using the correct query/url. – Aquaboltar May 10 '11 at 19:23
  • Just wondering, are you waiting for a random deletion, or are you explicitly deleting a tweet, and then not seeing it come across via the API? – muffinista May 10 '11 at 19:38
  • I haven't played with the streaming API enough, but I wonder if you're just not getting the deletion since there's no explicit guarantee at all that you will get particular tweets. – muffinista May 10 '11 at 19:49
  • I'll try a few more things but guessing the delete should come through the same way the tweets do (they appear every time I post). – Aquaboltar May 10 '11 at 20:19
  • Hey I tried a couple experiments, and added the results above. – muffinista May 10 '11 at 23:56