Twitter is a popular social network where users share messages called tweets. Twitter allows us to mine the data of any user using Twitter API or Tweepy. The data will be tweets extracted from the user. The first thing to do is get the consumer key, consumer secret, access key and access secret from twitter developer available easily for each user. These keys will help the API for authentication.
statuses_lookup() method of the
API class in Tweepy module is used to get the statuses specified by the status IDs, up to 100.
Syntax : API.statuses_lookup(parameters)
- id_ : A list of Tweet IDs to fetch, up to 100
- trim_user : A boolean indicating if user IDs should be provided, instead of complete user objects, the default value is False.
Returns : a list of objects of the class Status
Example 1 :
The status 1266978261701210112 is posted by geeksforgeeks This status says : Avoid errors, not client calls . Geeks, Keep this going... . #sundayvibes #programming #programmingmemes #coding https://t.co/JkA5iStofZ The status 1266735261012111360 is posted by geeksforgeeks This status says : With the access to our Job Portal, find the jobs that are best for you & experience happy placement journey.... . L… https://t.co/mzMMFVzjMv The status 1266342841648898049 is posted by geeksforgeeks This status says : My reaction to this Lockdown : "Der Lagi Lekin... Maine Ab Hai Jeena Seekh Liya" What's your reaction to it? .… https://t.co/nH9L0eewSr
Example 2: Using the
statuses_lookup() method with the trim_user parameter.
57741058 57741058 57741058
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course