Detect Tweet Deletion Using Twitter Streaming API

The Stream 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 request does not detect when the tweet is deleted. Is there any way to do this using the API?

Thanks in advance.

+6
source share
1 answer

According to the docs, you should 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 some tests to find out what was going on. First, I tried the filter URL with the track parameter, just like you, and confirmed the same behavior as you. Then I tried the URL with the "follow" setting, for example:

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

When I try to do this, I get both tweets and their delete messages. It's hard to know for sure without asking Twitter, but I wonder if you just don’t delete at all when using the track parameter, or if this is another problem in these lines.

+4
source

Source: https://habr.com/ru/post/887759/


All Articles