twitter-5-access-tweet-attributes

twitter-5-access-tweet-attributes


Access tweet attributes. While the json
formatting is a great help in trying to make sense of a tweet and in looking
for a particular tweet attribute information it would be even better if
you could just access the attribute values. The good news is you can. In this
example we are using the status object attributes to get at the data. You can
access a status from its index value. You can access the top-level attributes for
a status as well as drilling down to child level attributes. Notice that you
also utf-8 encode your text attribute. This will allow you to print the text no
matter what language or character set is used in the text so we’ve chosen to print here user ID,
screen name, profile image, URL, followers count and place. If we run the code you
will see that this is now nicely formatted in JSON. We can see the
attributes that we chose to print

Leave a Reply

Your email address will not be published. Required fields are marked *