(Jan-06-2018, 02:00 PM)mpd Wrote: The response is a string, you can use the json module to "load" the string as an object:Bye the look of his data and response this is already done.
I guess he use a library or Requests to get the data,they will return data same as using
json.loads()
(return a Python dictionary).@kappa123 what you get back is a Python dictionary with mixed in list.
This is common when get json back.
So if i just put you code in variable data
data = { '_total':112, ...
.Can use it to get data out.
>>> data['streams'][1]['channel'] {'_id': 49754222, 'broadcaster_language': 'en', 'broadcaster_type': '', 'created_at': '2013-10-04T04:40:06.886355Z', 'description': "Whats up all, I'm Hon Yolo and welcome to the community. We " 'are a family here so come in and enjoy the fun!', 'display_name': 'HonYolo', 'followers': 8819, 'game': 'Grand Theft Auto V', 'language': 'en', 'logo': 'https://static-cdn.jtvnw.net/jtv_user_pictures/347ae60c8343326d-profile_image-300x300.png', 'mature': True, 'name': 'honyolo', 'partner': False, 'profile_banner': 'https://static-cdn.jtvnw.net/jtv_user_pictures/honyolo-profile_banner-4e9846d200e548d4-480.png', 'profile_banner_background_color': '#000000', 'status': 'Honathan Yolo - 24H of Honathan - NoPixel GTA RP\n\n', 'updated_at': '2018-01-06T13:35:18.174199Z', 'url': 'https://www.twitch.tv/honyolo', 'video_banner': 'https://static-cdn.jtvnw.net/jtv_user_pictures/018e3a2d1044db68-channel_offline_image-1920x1080.png', 'views': 55054} >>> data['streams'][1]['channel']['display_name'] 'HonYolo'So you need to search for
hi and/or hey and/or hell
in dictionary,and then return
display_name
that say this.