 		let extensionPointType = availableExtensionPointTypes[selectedRow]
 		switch extensionPointType {
 		case .marsEdit, .microblog:
+			
 			let windowController = ExtensionPointEnableBasicWindowController()
 			windowController.extensionPointType = extensionPointType
 			windowController.runSheetOnWindow(self.view.window!)
 			extensionPointAddWindowController = windowController
-		default:
-			break
+			
+		case .twitter:
+
+			let oauth = OAuth1Swift(
+				consumerKey: Secrets.twitterConsumerKey,
+				consumerSecret: Secrets.twitterConsumerSecret,
+				requestTokenUrl: "https://api.twitter.com/oauth/request_token",
+				authorizeUrl:    "https://api.twitter.com/oauth/authorize",
+				accessTokenUrl:  "https://api.twitter.com/oauth/access_token"
+			)
+			
+			self.oauth = oauth
+			oauth.authorizeURLHandler = self
+			
+			oauth.authorize(withCallbackURL: callbackURL) { result in
+				switch result {
+				case .success(let tokenSuccess):
+					//				let token = tokenSuccess.credential.oauthToken
+					//				let secret = tokenSuccess.credential.oauthTokenSecret
+					let screenName = tokenSuccess.parameters["screen_name"] as? String ?? ""
+					
+					print("******************* \(screenName)")
+					
+				case .failure(let oauthSwiftError):
+					NSApplication.shared.presentError(oauthSwiftError)
+				}
+				
+				self.oauth?.cancel()
+				self.oauth = nil
+			}
+			
 		}
 		
 		tableView.selectRowIndexes([], byExtendingSelection: false)

	
}

// MARK: OAuthAccountAuthorizationOperationDelegate

//extension AccountsAddViewController: OAuthAccountAuthorizationOperationDelegate {
//
//	func oauthAccountAuthorizationOperation(_ operation: OAuthAccountAuthorizationOperation, didCreate account: Account) {
//		account.refreshAll { [weak self] result in
//			switch result {
//			case .success:
//				break
//			case .failure(let error):
//				self?.presentError(error)
//			}
//		}
//	}
//
//	func oauthAccountAuthorizationOperation(_ operation: OAuthAccountAuthorizationOperation, didFailWith error: Error) {
//		view.window?.presentError(error)
//	}
//}

//

import AppKit
import AuthenticationServices
import Secrets
import OAuthSwift
import FeedProvider

class ExtensionPointAddViewController: NSViewController {
