public static void GetTweets(string consumerKey, string consumerSecret)
{
ConsoleOutput.PrintMessage("Welcome to BoxKite.Twitter Console");
ConsoleOutput.PrintMessage("(control-c ends)");
System.Console.CancelKeyPress += cancelStreamHandler;
TwitterCredentials twittercredentials = null;
TwitterConnection = new TwitterConnection(consumerKey, consumerSecret);
// PIN based authentication
var oauth = TwitterConnection.BeginUserAuthentication().Result;
// if the response is null, something is wrong with the initial request to OAuth
if (!string.IsNullOrWhiteSpace(oauth))
{
ConsoleOutput.PrintMessage("Pin: ");
var pin = System.Console.ReadLine();
twittercredentials = TwitterConnection.CompleteUserAuthentication(pin, oauth).Result;
ManageTwitterCredentials.SaveTwitterCredentialsToFile(twittercredentials);
}
else
{
ConsoleOutput.PrintError("Cannot OAuth with Twitter");
}
GetTweets(twittercredentials);
ConsoleOutput.PrintMessage("All Finished");
System.Console.ReadLine();
}