twitter direct messages without recipient

108 views
Skip to first unread message

Vadym Khokhlov

unread,
Aug 18, 2011, 8:52:14 AM8/18/11
to twitter-deve...@googlegroups.com
I have problem with parsing some direct messages. As described here:

JSONed direct message contains key  'recipient'. Value of this key is dictionary with information about dm's recipient. And I parsing this information like this (in python):

res_msg['receivers'] = msg['recipient']['screen_name']

But for several messages I've got error for code above: 
TypeError: string indices must be integers, not str

Why in this case msg['recipient'] is not dictionary?
How can I get screen name of recipient?
Does 'recipient_screen_name' value always contains screen name or also may be empty?

Reply all
Reply to author
Forward
0 new messages