I'm trying to build a python program to get tweets based around a certain keyword. However, while I can successfully retrieve tweets, they come back truncated.
How can I get the full text of a tweet?
CODE: (Sample output below code) (python-twitter module)
import twitter
api = twitter.Api(consumer_key=CONSUMER_KEY,
consumer_secret=CONSUMER_SECRET,
access_token_key=ACCESS_TOKEN,
access_token_secret=ACCESS_SECRET)
results = api.GetSearch(term="car", since="2018-04-11", until="2018-04-12", count=5)
for twt in results:
tempTweet = (str(twt))
tweet = json.loads(tempTweet)
for key in tweet:
print(str(key) + ": " + str(tweet[key]))
print("#############################################")
SAMPLE OUTPUT:
created_at: Wed Apr 11 20:55:25 +0000 2018
favorite_count: 1573
hashtags: []
id: 984173096566341632
id_str: 984173096566341632
lang: en
retweet_count: 1480
source: <a href="https://about.twitter.com/products/tweetdeck" rel="nofollow">TweetDeck</a>
**text**: Caution: Disturbing video. Car speeds through red light, striking pedestrian during vigil Wednesday for cyclist kil… **SHORTENEDURLHERE**
truncated: True
urls: [{'expanded_url':'https://twitter.com/i/web/status/984173096566341632', 'url':**SHORTENEDURLHERE**}]
user: {'created_at': 'Wed Nov 14 17:43:42 +0000 2007', 'description': 'KTLA has been keeping Southern California informed since 1947. \n\nHave great video, photos or story tips? Share with us using #ktla.', 'favourites_count': 1078, 'followers_count': 717397, 'friends_count': 769, 'geo_enabled': True, 'id': 10252962, 'id_str': '10252962', 'lang': 'en', 'listed_count': 3885, 'location': 'Los Angeles, CA', 'name': 'KTLA', 'profile_background_color': '040718', 'profile_background_image_url': 'http://pbs.twimg.com/profile_background_images/507323957578436608/olqcU4MS.jpeg', 'profile_background_image_url_https': 'https://pbs.twimg.com/profile_background_images/507323957578436608/olqcU4MS.jpeg', 'profile_banner_url': 'https://pbs.twimg.com/profile_banners/10252962/1369959990', 'profile_image_url': 'http://pbs.twimg.com/profile_images/809849913240481792/YQ0aT9hv_normal.jpg', 'profile_image_url_https': 'https://pbs.twimg.com/profile_images/809849913240481792/YQ0aT9hv_normal.jpg', 'profile_link_color': '24009C', 'profile_sidebar_border_color': 'FFFFFF', 'profile_sidebar_fill_color': '95E8EC', 'profile_text_color': '3C3940', 'profile_use_background_image': True, 'screen_name': 'KTLA', 'statuses_count': 144937, 'time_zone': 'Pacific Time (US & Canada)', 'url': '**SHORTENEDURLHERE**', 'utc_offset': -25200, 'verified': True}
user_mentions: []
#############################################