using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using TwitterTest;
namespace TwitterControl
{
public partial class TwitterControl : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
// Setup Request
Twitter.ScreenName = "Test"; // This can be any twitter account
Twitter.Count = 20;
// These can be found in your developers seciton of twitter dev.twitter.com and in your applications
Twitter.oAuthConsumerKey = "";
Twitter.oAuthConsumerSecret = "";
Twitter.oAuth_token = "";
// Generate Random Base 64 Code
Twitter.oAuth_nonce = Twitter.generateNonce();
// Signature Method
Twitter.oAuth_signature_method = "HMAC-SHA1";
// Timestamp
Twitter.oAuth_timestamp = DateTime.Now.ToString();
// API Version
Twitter.oAuth_version = "1.1";
twitterRepeater.DataSource = Twitter.RetrieveTweets();
twitterRepeater.DataBind();
}
}
}
2 comments:
That's nice, can I add this example to my open source working demo?
My demo includes a very simple working example of Twitter API 1.1 in ASP.NET.
Yer sure go for it, I have another cleaner version I am working on, but I just haven't had time to make it as good as I would like.
Glad you liked it anyway, its a starting point if nothing else.
Post a Comment