Esempio n. 1
0
        void twitterInit()
        {
            if (token != "?" && secret != "?")
            {
                twitter = new Twitter(token, secret, lastTweet);

                Twitter.DisplayPictures = twDisplayPictures;
                Twitter.DisplayInstagrams = twDisplayInstagrams;
                twPrevCountBelowThreshold = true;

                if (!twitter.VerifyCredentials())
                {
                    print("Error while initializing Twitter service.<pause>", errorColor);
                    printHelp("To see more information about this error please type the following command: \"help twitter /init\"");
                    return;
                }

                if (twitter.GetNewTweets(lastTweet))
                    lastTweet = Math.Max(lastTweet, twitter.GetLastTweet());
                else
                    printError("Could not get a list of new tweets.", twitter.TwException);

                if (!twitter.EstablishStreamConnection())
                    printError("Could not establish a connection to Twitter's streaming API.", twitter.TwException);
            }
        }
Esempio n. 2
0
        void twitterAuth()
        {
            print("You need to authorize Adjutant (console) before you can use it as a Twitter client.");
            print("The authorization URL has been launched in your browser.");
            print("Please click on \"Authorize app\" and then copy the given PIN into Adjutant.");

            if (twitter == null)
                twitter = new Twitter();

            Uri uri = twitter.GetAuthorizationUri();

            if (uri == null)
                printError("Error while getting Twitter authorization URI.", twitter.TwException);
            else
            {
                Process.Start(uri.ToString());

                inputMode = InputMode.TwitterPIN;
                setPrompt();
            }
        }