Convert Tweepy Status object into JSON
A better way to do this is to use a tweepy parser. It's not documented very well - see the Tweepy API reference - but it's a public API, so much safer than using the _json
property.
import tweepyauth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)api = tweepy.API(auth, parser=tweepy.parsers.JSONParser())status = api.user_timeline(user=username, count=1)[0]json.dumps(status)
status
is now a json object.