.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Post New Web Links

Twitter API...help!!

Posted By:      Posted Date: September 07, 2010    Points: 0   Category :ASP.Net
Hi,I was trying to use Twitter API but was stuck at first step itself i.e., while requesting token. Below is the code I am usingpublic string RequestToken() { string HTTPVerb = "POST"; OAuthBase oab = new OAuthBase(); string ConsumerSecret = "***********************************"; string normalizedURL = ""; string normalizedParams = ""; string ReqUrl = "https://api.twitter.com/oauth/request_token"; Uri ReqUri = new Uri(ReqUrl); //oauth_callback string CallBackURL = "http://localhost:3335/MainWeb/CallBack.aspx"; //oauth_consumer_key string ConsumerKey = "*****************"; //oauth_nonce string UniqueId = oab.GenerateNonce(); //oauth_signature_method string SignMethod = "HMAC-SHA1"; //oauth_timestamp string TimeStamp = oab.GenerateTimeStamp(); //oauth_version string OAuthVersion = "1.0"; string Response =""; string Data = "oauth_callback=" + CallBackURL; Data += "&oauth_consumer_key=" + ConsumerKey; Data += "&oauth_nonce=" + UniqueId; Data += "&am

View Complete Post

More Related Resource Links

Where can I find the code of the Twitter or Facebook or WebGrid helpers?


Just in general, where can I find the code to take a look at and learn from them? Or at least look at the functions available to me as I do get the feeling that the insufficient documentation at the moment reveals all.

Visual Studio asp C#.NEt web application publishing tweet/status on Twitter/Facebook

Hi guysIf you could give me some guidelines It would mean a lot to me. what type of authentication I use, how to do  id from localhost, how to modify web.config file etc 

Twitter - Simple way to show tweets using the API?

I want to display the last 4 tweets on my website.  I've done the following below which works fine but I'd like all of the urls and twitter names in the title to be hyperlinked.  Is parsing the title the best option or is there another approach I should take?Sub GetTweets() Dim xmlDoc = New System.Xml.XmlDocument xmlDoc.Load("http://search.twitter.com/search.atom?q=asp.net&rpp=4") 'create the select the nodes Dim root As System.Xml.XmlElement = xmlDoc.DocumentElement Dim nodeList As System.Xml.XmlNodeList = xmlDoc.GetElementsByTagName("entry") lblTweets.Text = "" Dim uri = "" Dim name = "" Dim title = "" For i As Integer = 0 To nodeList.Count - 1 name = nodeList.Item(i).ChildNodes(9).ChildNodes(0).InnerText name = name.Substring(0, name.IndexOf("(")) uri = nodeList.Item(i).ChildNodes(9).ChildNodes(1).InnerText title = nodeList.Item(i).ChildNodes(3).InnerText lblTweets.Text += String.Format("@<a style='color:#01a54e;' href='{0}' target='_blank'>{1}</a> {2}<br />", _ uri, name, title) Next End Sub

Adding Twitter authentication support to ASP.NET application

In my last posting I introduced my idea about common membership provider for ASP.NET that is able to support multiple authentication providers. Before writing membership provider we need support for some authentication providers to get an better idea how to use them together. In this posting I will introduce you how to use OAuth protocol with Twitter. Before we start . . let me make some important notes and give some advises so you know better what is going on: OAuth is secure open-source authentication API that is used by Twitter and many other providers. You can find out more details about OAuth from their homepage at http://oauth.net/. There is also official specification for OAuth by Internet Engineering Task Force (IETF): The OAuth 1.0 Protocol. To make our sad lives easier there is library for .NET that makes it for us easier to support OAuth and OpenID protocols in our systems. This cool library is called DotNetOpenAuth. This library is also used by stackoverflow and MySpace. We will use the same library, so go and download it before starting with code. You need to register Twitter application. Go to page Twitter's application registration page and register new application. You need consumer key and consumer secret parameters of your application later. Copy "Sign in with Twitter" to some of your web application's folders where other images are. You need

Twitter sucks and must be run by amateurs

I can't say that I've ever known any kind of Web-based service to suck as much as Twitter, yet be as simple and popular. It really boggles the mind. As just a regular user, it can be annoying enough with the constant outages and failures. As a developer, it's even worse. In my case, I put a simple hook in CoasterBuzz to publish links from our news page using our cstr.bz short URL's. At the time, you could do simple authorization, as well as OAuth. Since I wasn't dealing in nuclear secrets, and the .NET libraries for OAuth and/or Twitter were somewhere between weak and non-existent, I took the path of least resistance and did up some basic auth against a super simple RESTful URL. It took all of five minutes. And hey, all the docs said is that they'd support basic auth for a long time (or something to that effect). Then yesterday, I noticed that the publishing is failing. I look at my error logs, and it's 401'ing. I do some looking around to find that they've turned off basic auth. To add insult to injury, I see this on their blog: Fortunately, developers have known about our transition to OAuth since last December, so they've had time to update their apps." Wow, really? Everyone knew? It's news to me. I pushed out my silly stuff in February, and there was no mention anywhere of any intention to discontinue basic auth, or dates or anything else. Lame. So I'm chatt

Twitter reader

Dear all,I have writing software Twitter reader by C# and reading from this link http://twitter.com/statuses/friends_timeline.xml , in the first time my soft run very good but since Twitter to change system to authentication account then my soft not work.Code twitter reader I used:        client = new WebClient(); client.Credentials = new NetworkCredential(user, pass); stream = client.OpenRead(APILink); reader = new StreamReader(stream); xml_read = new XmlTextReader(reader); xml_Doc = new XmlDocument(); xml_Doc.Load(xml_read); Please help me this problem.Thanks a lot,My email: kieungocdung@hotmail.com

Can animation extender be used to replicate Twitter's smooth-scrolling, latest-tweet control?

I'm not going for the exact same control, but if I can find a smart way to automatically/smoothly scroll through text from the database on Timer Tick intervals of 5 seconds... then I can use that as a template. My main idea would be to just dynamically create panels with the text inside of them, then dispose of them when they come towards the bottom of the list... but 3 things stop me 1) it would be a lot of work, 2) when the last panel cycles to the bottom of the display area then how do I make it smoothly disappear? 3) What would I use for the display spot?- a Panel won't work because if its contents exceed the set height, it either just expands to fit it or adds scroll bars. I basically want it to have slideshow functionallity how the images smoothly scroll every few seconds (without the scroll bar), and instead of images I want to use text. Any ideas?

Sharepoint Twitter-like app

Hi,   I'm looking for a way to have team members "twittering" with each other in a Sharepoint environment.  Twitter is public - I need a private team Sharepoint "twitter-nest"       

Sending a Tweet from VB.NET to Twitter

Well, it used to be pretty simple to send a Tweet to twitter from within my vb.net website. Now they have changed the rules using OAuth! I can't seem to find a simple solution to send tweets. All I am really sending are announcements as to what is going on. I need to be able to do it all behind the scenes whenever a new event is entered by the web site user. I Have the consumerKey and the consumerSecret, how do I get the PIN and the  OAuthToken, and the OAuthTokenSecret? Can anyone give me a valid VB Example that I can modify to work on my web site? No dll's just good, simple code. Thanks.

Get rid of Facebook and Twitter Crawlers



My scenario is:

I have a website that shares some content and shows the number of times it has been shared. The sharing is done through facebook, twitter and e-mail.

Now, while sharing the content with facebook and twitter, the share count gets increased by some random number, sometimes 2 and sometimes upto 25-30. The reason I could find is that the bots and crawlers of facebook and twitter keeps on hitting the content being shared which increases my share count.

Is there a way to stop these bots and crawlers from hitting my website?


Thanks in advance...:)


How does Twitter maintain password field on postback?


I know that for security reasons, it's generally frowned upon to try and maintain a password field on a postback, but I'd still like to figure out a way to have it done. For example, Twitter. If you try to start a new account, and let's say the username you've chosen has already been taken, the page posts back with an error. But, with Twitter, the password field does not clear. How are they doing this?

I find it annoying in a situation like this, because if the username is already taken, that means you have to go back and fill in the password field too.

How does Twitter do this?...

Twitter/Facebook/Myspace Integration with Asp.net site


Hey guys,

     I have a site that I want to integrate twitter, facebook, and myspace.  For the past week I have been pondering how would I go about doing this. I am thinking about doing the following:

1. ( This all when the user first create an account with my app) When the user clicks on for example the twitter  button and  authorize my application before the site goes to twitter authorization page the site will create a temp user and log in the user into the membership database when they are return to my call back page I check to see if that username is already in use, if not, I then delete the temp user from the membership database and then create a new entry with their twitter username.  If the username is in use, I let the user know. Also, I will add an additinal column to distinguish between myspace, twitter, and facebook within the membership table.

This is a good way to go about doing this. Any ideas would be appreciated. Thanks

Using Twitter oAuth to log in to Membership Provider


Before I begin experimenting with code, I thought I'd post this here so I can see if anyone else has already written a sample:  I'm developing a web application with standard ASP.NET membership providers (specifically using the SqlTableProfileProvider).  I want to add buttons for 'Sign in with Twitter' and 'Sign in with Facebook Connect'.  My challenge is to treat these people as authenticated users with profile data once they have connected using oAuth.

I'm thinking it might possibly take this route:

  1. User the Twitterizer framework to authenticate with Twitter via oAuth
  2. Retrieve the user's Twitter username
  3. User the membership provider's "CreateUser" function to create a user in the database with the same username as the Twitter handle, and with a randomly generated password (or alternatively leave the password field blank, but I assume it requires at least something for password)
  4. Log in the user through code, then get them to fill out their profile data.
  5. Then when they return, log-in the user (through code) if a successful connection to Twitter is made.

Would anyone agree this is the best path to take?


is twitter is a mvc application?


is twitter is a mvc application?

Twitter feed


Hi guys

Am stuck up with a task to display tweets from a particular user in website's home page.

The website uses a web service which inturn uses Twitter APi to fetch tweets.

The thing is Twitter Api returns tweets in a page containing tweets, posted over a week.

results per page is sent as a parameter. But for one request call the web service can return only one page which contains tweets for a period of one week. 

But i want to fetch tweets posted over last three months.......

Can any one help me.......

thanks in advance

Problem creating a link to Twitter


Hi all,

I need to create some links to the Twitter search page.

In my first example 'link1', that works fine, when you click the link you go to the twitter search results for 'wc2010'.

However, in my second link I want to search for the hashtag+wx2010, which is how data is related/grouped on Twitter. My second link always just redirects to a user called 'wc20210' which is not what I want. How can I create a link to a  hashtagged word on Twitter?

string link1 = "<a href='http://www.twitter.com/search?q=wc2010'>Link 1 to Twitter</a>";
string link2 = "<a href='http://www.twitter.com/search?q=#wc2010'>Link 2 to Twitter</a>";

Response.Write(link1.ToString() + "<p>");



ASP.NET: GridView CRUD using Twitter Bootstrap Modal Popup

This article explains how to use ASP.NET GridView with the simple and rich Twitter Bootstrap's Modal jQuery plugin to implement a complete CRUD package in ASP.NET Web Forms Application.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend