Adding sign in with twitter functionality to my website


#1

I’m using the following code to log into and log out of my website using user’s twitter account. I’m using the following code:

<script type="text/javascript">
	twttr.anywhere(function (T) {
		if (T.isConnected()) {	 
			$("#twitter-login-button").html('<img id="twitter-signout" src="images/twitterLogOutButton.png">');	 
			$("#twitter-signout").bind("click", twttr.anywhere.signOut);
		} else {
			$("#twitter-login-button").html(' ');
			T("#twitter-login-button").connectButton();
	        }
		
		T.bind("authComplete", function (e, user) {
		  // triggered when auth completed successfully
			$("#twitter-login-button").html('<img id="twitter-signout" src="images/twitterLogOutButton.png">');	 
			$("#twitter-signout").bind("click", twttr.anywhere.signOut);
		});
	 
		T.bind("signOut", function (e) {
		  // triggered when user logs out
			$("#twitter-login-button").html(' ');
			T("#twitter-login-button").connectButton();
		});	
	});
</script>

The code does nothing more than T("#twitter-login-button").connectButton(); and does not implement the signout functionality. Could someone please tell me what’s wrong?


#2

could you tell me which api you are using, if possible give me the url. Thank you