Created
August 14, 2012 12:52
-
-
Save jsakamoto/3349049 to your computer and use it in GitHub Desktop.
C# で Twitterizer を使って Twitter につぶやく
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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