Python – API.list_timeline() in Tweepy
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.
list_timeline() method of the
API class in Tweepy module is used to fetch timeline of tweets authored by members of the specified list.
Syntax : API.list_timeline(parameters)
- list_id : ID of the list.
- slug : slug of the list.
- owner_id : ID of the owner of the list.
- owner_screen_name : screen name of the owner of the list.
- since_id : minimum limit on the ID of the status.
- max_id : >maximum limit on the ID of the status.
- count : the number of statuses to be fetched.
- include_entities : a boolean to include entity nodes.
- include_rts : a boolean to include retweets.
Returns : a list of objects of class Status
Example 1 :
The number of statuses fetched from the list are : 17
Example 2 : Only fetching a certain number of statuses using the parameter count.
The number of statuses fetched from the list are : 3
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