Какой функцией обработать следующее сообщение?

N
На сайте с 08.03.2010
Offline
13
402


{'businesses': [{'address1': '466 Haight St',
'address2': '',
'address3': '',
'avg_rating': 4.0,
'categories': [{'category_filter': 'danceclubs',
'name': 'Dance Clubs',
'search_url': 'http://yelp.com/search?find_loc=466+Haight+St%2C+San+Francisco%2C+CA&cflt=danceclubs'},
{'category_filter': 'lounges',
'name': 'Lounges',
'search_url': 'http://yelp.com/search?find_loc=466+Haight+St%2C+San+Francisco%2C+CA&cflt=lounges'},
{'category_filter': 'tradamerican',
'name': 'American (Traditional)',
'search_url': 'http://yelp.com/search?find_loc=466+Haight+St%2C+San+Francisco%2C+CA&cflt=tradamerican'}],
'city': 'San Francisco',
'distance': 1.8780401945114136,
'id': 'yyqwqfgn1ZmbQYNbl7s5sQ',
'is_closed': False,
'latitude': 37.772201000000003,
'longitude': -122.42992599999999,
'mobile_url': 'http://mobile.yelp.com/biz/yyqwqfgn1ZmbQYNbl7s5sQ',
'name': 'Nickies',
'nearby_url': 'http://yelp.com/search?find_loc=466+Haight+St%2C+San+Francisco%2C+CA',
'neighborhoods': [{'name': 'Hayes Valley',
'url': 'http://yelp.com/search?find_loc=Hayes+Valley%2C+San+Francisco%2C+CA'}],
'phone': '4152550300',
'photo_url': 'http://static.px.yelp.com/bpthumb/mPNTiQm5HVqLLcUi8XrDiA/ms',
'photo_url_small': 'http://static.px.yelp.com/bpthumb/mPNTiQm5HVqLLcUi8XrDiA/ss',
'rating_img_url': 'http://static.px.yelp.com/static/20070816/i/ico/stars/stars_4.png',
'rating_img_url_small': 'http://static.px.yelp.com/static/20070816/i/ico/stars/stars_small_4.png',
'review_count': 32,
'reviews': [{'id': 't-sisM24K9GvvYhr-9w1EQ',
'rating': 3,
'rating_img_url': 'http://static.px.yelp.com/static/20070816/i/ico/stars/stars_3.png',
'rating_img_url_small': 'http://static.px.yelp.com/static/20070816/i/ico/stars/stars_small_3.png',
'text_excerpt': 'So I know gentrification is supposed to be a bad word and all (especially here in SF), but the Lower Haight might benefit a bit from it. At least, I like...',
'url': 'http://yelp.com/biz/yyqwqfgn1ZmbQYNbl7s5sQ#hrid:t-sisM24K9GvvYhr-9w1EQ',
'user_name': 'Trey F.',
'user_photo_url': 'http://static.px.yelp.com/upthumb/ZQDXkIwQmgfAcazw8OgK2g/ms',
'user_photo_url_small': 'http://static.px.yelp.com/upthumb/ZQDXkIwQmgfAcazw8OgK2g/ss',
'mobile_uri': 'http://mobile.yelp.com/biz/yyqwqfgn1ZmbQYNbl7s5sQ?srid=t-sisM24K9GvvYhr-9w1EQ',
'user_url': 'http://yelp.com/user_details?userid=XMeRHjiLhA9cv3BsSOazCA'},
{'id': '8xTNOC9L5ZXwGCMNYY-pdQ',
'rating': 4,
'rating_img_url': 'http://static.px.yelp.com/static/20070816/i/ico/stars/stars_4.png',
'rating_img_url_small': 'http://static.px.yelp.com/static/20070816/i/ico/stars/stars_small_4.png',
'text_excerpt': 'This place was definitely a great place to chill. The atmosphere is very non-threatening and very neighborly. I thought it was cool that they had a girl dj...',
'url': 'http://yelp.com/biz/yyqwqfgn1ZmbQYNbl7s5sQ#hrid:8xTNOC9L5ZXwGCMNYY-pdQ',
'user_name': 'Jessy M.',
'user_photo_url': 'http://static.px.yelp.com/upthumb/Ghwoq23_alkaXawgqj7dBA/ms',
'user_photo_url_small': 'http://static.px.yelp.com/upthumb/Ghwoq23_alkaXawgqj7dBA/ss',
'mobile_uri': 'http://mobile.yelp.com/biz/yyqwqfgn1ZmbQYNbl7s5sQ?srid=8xTNOC9L5ZXwGCMNYY-pdQ',
'user_url': 'http://yelp.com/user_details?userid=4F2QG3adYIUNXplqqp9ylA'},
{'id': 'pp33WfN_FoKlQKJ-38j_Ag',
'rating': 5,
'rating_img_url': 'http://static.px.yelp.com/static/20070816/i/ico/stars/stars_5.png',
'rating_img_url_small': 'http://static.px.yelp.com/static/20070816/i/ico/stars/stars_small_5.png',
'text_excerpt': "Love this place! I've been here twice now and each time has been a great experience. The bartender is so nice. When we had questions about the drinks he...",
'url': 'http://yelp.com/biz/yyqwqfgn1ZmbQYNbl7s5sQ#hrid:pp33WfN_FoKlQKJ-38j_Ag',
'user_name': 'Scott M.',
'user_photo_url': 'http://static.px.yelp.com/upthumb/q0POOE3vv2LzNg1qN8MMyw/ms',
'user_photo_url_small': 'http://static.px.yelp.com/upthumb/q0POOE3vv2LzNg1qN8MMyw/ss',
'mobile_uri': 'http://mobile.yelp.com/biz/yyqwqfgn1ZmbQYNbl7s5sQ?srid=pp33WfN_FoKlQKJ-38j_Ag',
'user_url': 'http://yelp.com/user_details?userid=FmcKafW272uSWXbUF2rslA'}],
'state': 'CA',
'state_code': 'CA',
'country': 'USA',
'country_code': 'US',
'url': 'http://yelp.com/biz/nickies-san-francisco',
'zip': '94117'}],
'message': {'code': 0, 'text': 'OK', 'version': '1.1.0'}}

Задача - как сделать многомерный массив данных?! Задумываюсь об использовании регулярных выражений, но этого откровенно делать не хочется. СПАСИБО!

kanonir
На сайте с 27.10.2010
Offline
2
#1

json_decode()

мой блог (http://comphobby.ru)

Авторизуйтесь или зарегистрируйтесь, чтобы оставить комментарий