Ejemplo n.º 1
0
        public void OnPluginEnable()
        {
            if (twttrAccessToken == null)
            {
                // we need to auth.
                OAuthCredentials accessToken = TwitterHelper.PerformOAuth(CONSUMER_KEY, CONSUMER_SECRET);
                consoleWrite("^8OAuth Successful. Please copy and paste the following values into the plugin configuration, and reactivate: ");
                consoleWrite("Access Token: " + accessToken.Token);
                consoleWrite("Access Token Secret: " + accessToken.Secret);
                consoleWrite("Please keep the token secret safe. You can unauthorize this application at any time from your Twitter account settings.");
                setPluginState(false);
                return;
            }

            twttrService = TwitterHelper.CreateClient(CONSUMER_KEY, CONSUMER_SECRET, twttrAccessToken.Token, twttrAccessToken.Secret);
            consoleWrite("Twitter client created successfully.");
        }