我正在使用请求从地理边界区域获取推文。当我尝试打印结果时,我得到的是结果摘要,而不是结果本身。我的代码是:
from __future__ import unicode_literals
import requests
from requests_oauthlib import OAuth1
import pprint
consumer_key=""
consumer_secret=""
access_key=""
access_token_secret=""
access_token=""
header_auth=True
url = 'https://api.twitter.com/1.1/search/tweets.json'
headeroauth = OAuth1(consumer_key, consumer_secret,
access_key, access_token_secret,
signature_type='auth_header')
query_params = { 'q': 'the',
'geocode': '33.520661, -86.80249, 50mi'
}
response = requests.get(url, auth=headeroauth, params=query_params)
data = response.json()
pprint.pprint(data)
我得到的回应是:
{u'search_metadata': {u'count': 15, u'completed_in': 0.025000000000000001,
u'max_id_str': u'349363977614143489', u'since_id_str': u'0', u'refresh_url': u'
since_id=349363977614143489&q=the&geocode=33.520661%2C%20
86.80249%2C%2050mi&include_entities=1', u'since_id': 0, u'query': u'the', u'max_id': 349363977614143489}, u'statuses': []}
如何设置它以返回推文的实际内容?谢谢!