import tweepy
# Twitter API credentials
consumer_key = "Your_Consumer_Key"
consumer_secret = "Your_Consumer_Secret"
access_token = "Your_Access_Token"
access_token_secret = "Your_Access_Token_Secret"
# Authenticate to Twitter
auth = tweepy.OAuth1UserHandler(consumer_key, consumer_secret, access_token, access_token_secret)
# Create API object
api = tweepy.API(auth)
# Fetch and display the latest tweets from AKB48
def show_latest_tweets(username, count):
tweets = api.user_timeline(screen_name=username, count=count, tweet_mode="extended")
print(f"Latest tweets from {username}:")
for tweet in tweets:
print(f"{tweet.created_at}: {tweet.full_text}\n")
if __name__ == "__main__":
show_latest_tweets("AKB48", 5) # Change the count as per your requirement