python - Re-Parsing JSON -
i have tweet data need parse:
"{u'contributors': none, u'truncated': false, u'text': u'', u'in_reply_to_status_id': none, u'id': 325495490122772480l, u'favorite_count': 0, u'source': u'<a href=""http://itunes.apple.com/us/app/imdb-movies-tv/id342792525?mt=8&uo=4"" rel=""nofollow"">imdb movies & tv on ios</a>', u'retweeted': false, u'coordinates': none, u'entities': {u'symbols': [], u'user_mentions': [{u'indices': [56, 68], u'id_str': u'244186942', u'screen_name': u'ploughman71', u'name': u'paul hughes', u'id': 244186942}], u'hashtags': [{u'indices': [50, 55], u'text': u'imdb'}], u'urls': [{u'url': u'...', u'indices': [27, 49], u'expanded_url': u'...', u'display_url': u'imdb.com/title/tt0068646'}]}, u'in_reply_to_screen_name': none, u'id_str': u'325495490122772480', u'retweet_count': 0, u'in_reply_to_user_id': none, u'favorited': false, u'user': {u'follow_request_sent': false, u'profile_use_background_image': true, u'contributors_enabled': false, u'id': 171859103, u'verified': false, u'profile_text_color': u'333333', u'profile_image_url_https': u'...', u'profile_sidebar_fill_color': u'ddeef6', u'entities': {u'description': {u'urls': []}}, u'followers_count': 190, u'profile_sidebar_border_color': u'c0deed', u'location': u'pengwern ', u'default_profile_image': false, u'id_str': u'171859103', u'is_translation_enabled': false, u'utc_offset': none, u'statuses_count': 5107, u'description': u""my soul have coz dont mean shit i'd sell devil hit"", u'friends_count': 1163, u'profile_link_color': u'0084b4', u'profile_image_url': u'...', u'notifications': false, u'geo_enabled': true, u'profile_background_color': u'c0deed', u'profile_banner_url': u'...', u'profile_background_image_url': u'...', u'screen_name': u'jay_me7', u'lang': u'en', u'following': false, u'profile_background_tile': false, u'favourites_count': 104, u'name': u'jamie david williams', u'url': none, u'created_at': u'wed jul 28 10:13:24 +0000 2010', u'profile_background_image_url_https': u'...', u'time_zone': none, u'protected': false, u'default_profile': true, u'is_translator': false, u'listed_count': 2}, u'geo': none, u'in_reply_to_user_id_str': none, u'possibly_sensitive': false, u'lang': u'en', u'created_at': u'sat apr 20 06:25:46 +0000 2013', u'in_reply_to_status_id_str': none, u'place': none}"
when search json_obj['time_zone'] gives me error key doesn't exist there, catch it's within 'user' entity gets hidden @ first layer. not sure how can extract "time_zone" key above string?
any appreciated.
like this:
json_obj['user']['time_zone']
Comments
Post a Comment