Created
May 7, 2011 09:09
-
-
Save mach3/960347 to your computer and use it in GitHub Desktop.
@anywhereでフォローまわりを。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
twttr.anywhere( function(tw){ | |
var id_str, followMe; | |
id_str = "XXXXXXXXX"; | |
followMe = function(){ | |
if( !tw.isConnected() ){ | |
tw.bind( "authComplete", followMe ); | |
tw.signIn(); | |
return; | |
} | |
tw.currentUser.isFollowing( id_str, function( f ){ | |
if( f ){ | |
alert( "もう既にフォローしています" ); | |
} else { | |
if( confirm( "本当にフォローしちゃっていいですか?" ) ){ | |
( new tw.User({ id:id_str }) ).follow(function(){ | |
alert( "フォローしました" ); | |
}); | |
} | |
} | |
}); | |
}; | |
$("#followme").click( followMe ); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment