Skip to content

Instantly share code, notes, and snippets.

@jsakamoto
Created August 14, 2012 12:52
Show Gist options
  • Save jsakamoto/3349049 to your computer and use it in GitHub Desktop.
Save jsakamoto/3349049 to your computer and use it in GitHub Desktop.
C# で Twitterizer を使って Twitter につぶやく
using System.Configuration;
using Newtonsoft.Json;
using Twitterizer;
public class Bot
{
public static void Tweet()
{
// Need appSettings section in .config:
// <add key="key" value="{ConsumerKey:'...', ConsumerSecret:'...', AccessToken:'...', AccessTokenSecret:'...'}" />
var key = ConfigurationManager.AppSettings["key"];
var tokens = JsonConvert.DeserializeObject<OAuthTokens>(key);
TwitterStatus.Update(tokens, "つぶやいてみるよ。");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment