Anyway, the big idea would be to code something using the Twitter API, and then tweet about it.
The first thing I noticed was how many examples on the web were out of date. Twitter's implementation of the OAuth (August 16, 2010), before it was much simpler, however safe is good too.
Some links I found useful, the main stuff from twipler is especially useful, and I use to show how to do a simple post based on the tweetsharp libs:
MAIN: http://blog.twipler.com/A34_Simple_Twitter_web_client_example.html
TWITTER SETUP: http://blog.twipler.com/A32_Registering_a_new_Twitter_application.html
LIBRARY:
http://dev.twitter.com/pages/basic_to_oauth
http://apiwiki.twitter.com/OAuth-Examples
Taking the twipler example we can add a small button to tweet.
1. In the interface file add another button (called btnTweet with the following values (if placed after the timeline button it will show up at line 18 of Default.aspx and will modify the designer page as well (go through the UI interface to avoid any issues.)
<asp:Button ID="btnTweet" runat="server" Text="Tweet" OnClick="btnTweet_Click">
2. Add the following code to Default.aspx.cs:
protected void btnTweet_Click(object sender, EventArgs e)3. Change the TweetSharpHelper.cs class CreateRequest method to public (instead of private).
{
string response = Helper.Request(t => t.Statuses().Update(txtBox.Text), false);
litOutput.Text = "<h3>Tweet</h3>" + response;
}
public IFluentTwitter CreateRequest()4. Set the ConsumerKey and ConsumerSecret if you haven't already.
5. Run the application and tweet away (type the message in the text box and hit tweet)!
Many will ask what this has to do with games... well, how many facebook games are there now? How many more with the Playstation Home and Mii's running around? Nearly every device will attempt to talk with every other eventually, and it will only be a matter of time before every headshot you register shows up on your twitter post, facebook wall and rss feed.
Follow me on twitter: http://twitter.com/#!/mayekol maybe I'll post something interesting sometime (but no promises :P)
Michael Hubbard
http://michaelhubbard.ca
No comments:
Post a Comment