Closed jsancio closed 12 years ago
If the JSON contains a 'delete' key word we can assume that it is a delete message. We are interested in the following properties:
json['delete']['status']['user_id_str'] -> The id of the user from which the message was deleted. json['delete']['status']['id_str'] -> The id of the tweet which was deleted.
The current twitter stream handler is not setup to handle delete messages. We need to handle them correctly and send the notification to the processor.
The delete message looks as follow:
ERROR 2012-07-20 08:25:00,667 140702842529536 /opt/tim/thisis.me/event_twitter_feed/driver.py:270] Error handling twitter event: {"delete":{"status":{"user_id_str":"6273552","id_str":"225839729822797825","id":225839729822797825,"user_id":6273552}}} Traceback (most recent call last): File "/opt/tim/thisis.me/event_twitter_feed/driver.py", line 268, in lineReceived self.handler.handle(json_serializer.load_string(line)) File "/opt/tim/thisis.me/event_twitter_feed/driver.py", line 174, in handle service_author_id = interpreter.service_author_id() File "/opt/tim/thisis.me/commons/event_interpreter/twitter_event_interpreter.py", line 44, in service_author_id return self.json['user']['id_str']KeyError: 'user'