Twitter API with C#.NET
-
Friday, February 10, 2012 9:21 PM
Hi,
I have a software design in ASP.NET using C#. I want to integrate Twitter API into my existing software.
Scenario is something like this: If I tweet anything on my Twitter it should show up on my software.
How should I achieve this? Can anyone help me out? I have no idea how to used Twitter API with C#.NET.
Thanks!
Rushabh
Answers
-
Tuesday, February 14, 2012 6:38 PM
You can try with another overload of the HomeTimeline method:
HomeTimeline(OAuthTokens, TimelineOptions)
It tooks a TimelineOptions object in which you can specify some search options. In particular, take a look to its Count property, that allows to set the number of messages to request.
Marco Minerva [MCPD]
Blog: http://blogs.ugidotnet.org/marcom
Twitter: @marcominerva- Marked As Answer by ShahRushabh Tuesday, February 14, 2012 9:36 PM
All Replies
-
Friday, February 10, 2012 9:29 PM
You can use Twitterizer: http://www.twitterizer.net/.Marco Minerva [MCPD]
Blog: http://blogs.ugidotnet.org/marcom
Twitter: @marcominerva- Proposed As Answer by Horizon_Net Saturday, February 11, 2012 10:39 AM
- Marked As Answer by Rocky YueMicrosoft Community Contributor, Moderator Monday, February 13, 2012 6:35 AM
- Unmarked As Answer by ShahRushabh Monday, February 13, 2012 9:49 PM
-
Monday, February 13, 2012 10:14 PM
Hi Marco,
I did tried using twitterizer for Twitter API but still I am not able to find any proper solution for my problem.
I have a twitter account. So, whenever I update any status on Twitter it should show up on my desktop application.
If possible, can you provide some example on that.
Thanks.
Rushabh
-
Monday, February 13, 2012 10:31 PM
The library provides methods to read your Twitter status, so you must periodically check it in order to see if there is any update.
In particular, you can use the TwitterTimeline.HomeTimeline method. In this post: http://stackoverflow.com/questions/7922101/twittertimeline-hometimeline-only-returns-my-tweets you can find a simple example of its usage.
Marco Minerva [MCPD]
Blog: http://blogs.ugidotnet.org/marcom
Twitter: @marcominerva- Edited by Marco Minerva Monday, February 13, 2012 10:40 PM
-
Tuesday, February 14, 2012 5:52 PM
Hi Marco,
Thanks for your reply. I was able to read the tweet from my Twitter account using this code,
TwitterResponse<TwitterStatusCollection> response = TwitterTimeline.HomeTimeline(tokens);
Is there any way to read most recent tweet only. Because from this code it reads all the tweet from my account.
Thanks!
Rushabh
-
Tuesday, February 14, 2012 6:38 PM
You can try with another overload of the HomeTimeline method:
HomeTimeline(OAuthTokens, TimelineOptions)
It tooks a TimelineOptions object in which you can specify some search options. In particular, take a look to its Count property, that allows to set the number of messages to request.
Marco Minerva [MCPD]
Blog: http://blogs.ugidotnet.org/marcom
Twitter: @marcominerva- Marked As Answer by ShahRushabh Tuesday, February 14, 2012 9:36 PM
-
Wednesday, February 22, 2012 6:14 PM
Hi Marco,
Sorry to bothered you much but I need one more favor.
Everything works fine with my twitter application but I am not able to read URL properly. It displays tiny URL. How to convert tiny URL into long URL?
Here is my code,
TwitterResponse
<TwitterStatusCollection> response = TwitterTimeline.HomeTimeline(tokens);
foreach (TwitterStatus status in response.ResponseObject)
{
string stringId = status.StringId;
if (status.User.Id == )
{
myStatusCollection.Add(status.Text);
}
}Thanks for your help!!
Rushabh
-
Wednesday, February 22, 2012 6:44 PM
Tweets contain URL in tiny format. Why do you need to convert them in long form?
Marco Minerva [MCPD]
Blog: http://blogs.ugidotnet.org/marcom
Twitter: @marcominerva -
Wednesday, February 22, 2012 7:13 PMI am displaying twitter status in my .net application. Now, if my status have any link (which is directed to anyother website) user should be able to click or should be able to follow the link. Using tiny url it will increses confusion.
Rushabh
-
Wednesday, February 22, 2012 7:35 PM
You need to use a service like this one: http://www.clickonf5.org/2203/recover-original-url-short/.
Marco Minerva [MCPD]
Blog: http://blogs.ugidotnet.org/marcom
Twitter: @marcominerva -
Wednesday, February 22, 2012 7:43 PMIs there anything I can do using twitterizer.net rather than going with some other alternative?
Rushabh
-
Wednesday, February 22, 2012 7:46 PMNo, I'm sorry.
Marco Minerva [MCPD]
Blog: http://blogs.ugidotnet.org/marcom
Twitter: @marcominerva -
Wednesday, February 22, 2012 7:55 PMThanks!!
Rushabh
-
Wednesday, February 22, 2012 8:00 PMYou're welcome.
Marco Minerva [MCPD]
Blog: http://blogs.ugidotnet.org/marcom
Twitter: @marcominerva -
Monday, March 12, 2012 8:47 PM
Hi Macro,
I just observe few error in the program.
Error: In month of Feb I was able to read all the tweet on my Timeline with my User Id from past days.
eg) Tweet from 02/12/2012 or Tweet from 02/22/2012 - I was able to read both the tweet any time
But now, I am not able to read any tweet from last days or even from yesterday also. I am able to read recent tweet only.
Is there any update done in Twitter/Timeline that it doesn't allow to read old tweet even from yesterday also.
Do you have any idea about it. Do I need to change TwitterResponse<TwitterStatusCollection> - Rate Limiting - Reset Date.
Thanks for your answer.
Rushabh
-
Wednesday, May 09, 2012 7:57 AM
Hi,
You may want to have a look at the application provided here .This application show you tweets for a specified username and also allows you to export tweets to pdf,excel,word,image etc ..
http://blogs.gcpowertools.co.in/2012/05/activereporting-with-twitter.html

