Example #1
0
        public TwitterAuthService(BapesTwitterBotContext context, TwitterAppSettings appSettings)
        {
            _context = context;

            var appCredentials = new TwitterCredentials(appSettings.Key, appSettings.Secret);

            _authenticationContext = AuthFlow.InitAuthentication(appCredentials);
        }
Example #2
0
        public TwitterService(BapesTwitterBotContext context, TwitterUser user, TwitterAppSettings appSettings)
        {
            _context     = context;
            _user        = user;
            _appSettings = appSettings;

            Login();
        }
Example #3
0
        private static void Auth()
        {
            var appSettings = new TwitterAppSettings("CONSUMER_KEY", "CONSUMER_SECRET");

            var authService = new TwitterAuthService(new BapesTwitterBotContext(), appSettings);

            System.Console.WriteLine($"Auth URL: {authService.GetAuthUrl()}");

            System.Console.WriteLine("Twitter Username:"******"PIN:");
            var pin = System.Console.ReadLine();

            authService.AddUser(username, pin);

            System.Console.WriteLine("Added");
        }
Example #4
0
 public TwitterService(IOptions <TwitterAppSettings> twitterAppSettings)
 {
     _twitterAppSettings = twitterAppSettings.Value;
 }