Click here to Skip to main content
15,881,838 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello,

I need to display total tweet count of particular twitter account on my C# MVC website.

I only got share link button code which shows count of your twitter link shared but not tweet count code.

any code or link will be appreciated.

Thanks
Posted
Updated 28-Jul-15 3:35am
v2

A good library for using twitter api in c#.By exploring this api you will find a code like below

C#
TwitterCredentials.SetCredentials("ACCESS_TOKEN", "ACCESS_TOKEN_SECRET", "CONSUMER_KEY", "CONSUMER_SECRET");
var tweets = Timeline.GetHomeTimeline(100);


Reference:

https://tweetinvi.codeplex.com/[^]
 
Share this answer
 
# import the module
import tweepy

# assign the values accordingly
consumer_key = ""
consumer_secret = ""
access_token = ""
access_token_secret = ""

# authorization of consumer key and consumer secret
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)

# set access to user's access key and access secret
auth.set_access_token(access_token, access_token_secret)

# calling the api
api = tweepy.API(auth)

# the ID of the user
id = 57741058

# fetching the user
user = api.get_user(@icaivittiyagyan)

# fetching the statuses_count attribute
statuses_count = user.statuses_count

print("The number of statuses the user has posted are : " + str(statuses_count))
 
Share this answer
 
Comments
Richard Deeming 9-Jan-24 7:57am    
An unformatted, unexplained code-dump, using a third-party library you haven't mentioned, in a different language to the question, is NOT a solution to this 8½ year old question!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900