[twitter-dev] Re: @anywhere login code samples
Thanks, that helped me a lot. My Connect is working now! ;) On 15 Apr., 12:08, siggy andrewseig...@gmail.com wrote: Hi there, Some of the @anywhere sample code in the Working with the current user section required some tweaks to get working. The text specifies a User Callback function but the sample code does not. Also, the twttr.anywhere() function does not appear to work with an API key, instead I specify it with the anywhere.js file. Here is a modified code snippet that appears to work: //var anywhereApiKey = abcdefghi-123; //twttr.anywhere(anywhereApiKey, 1.0.0, onAnywhereLoad); twttr.anywhere(onAnywhereLoad); function onAnywhereLoad(twitter) { // Conditionally display the Connect Button based on current logged in state: if (twitter.isConnected) { twitter.User.current(user_callback); } else { twitter(#twitter-connect-placeholder).connectButton(); } }; function user_callback(currentUser) { screenName = currentUser.data('screen_name'); profileImage = currentUser.data('profile_image_url'); profileImageTag = img src=' + profileImage + '/; $('#twitter-connect-placeholder').innerHTML = Logged in as + profileImageTag + + screenName; }; Thanks, Andrew twitter.com/siggy_sf -- To unsubscribe, reply using remove me as the subject.
Re: [twitter-dev] Re: @anywhere login code samples
I must have had some outdated snippets still present in the docs, I'll do my best to adjust this morning when I have time. Taylor Singletary Developer Advocate, Twitter http://twitter.com/episod On Thu, Apr 15, 2010 at 7:56 AM, silentgecko rwelb...@brainpool.de wrote: Thanks, that helped me a lot. My Connect is working now! ;) On 15 Apr., 12:08, siggy andrewseig...@gmail.com wrote: Hi there, Some of the @anywhere sample code in the Working with the current user section required some tweaks to get working. The text specifies a User Callback function but the sample code does not. Also, the twttr.anywhere() function does not appear to work with an API key, instead I specify it with the anywhere.js file. Here is a modified code snippet that appears to work: //var anywhereApiKey = abcdefghi-123; //twttr.anywhere(anywhereApiKey, 1.0.0, onAnywhereLoad); twttr.anywhere(onAnywhereLoad); function onAnywhereLoad(twitter) { // Conditionally display the Connect Button based on current logged in state: if (twitter.isConnected) { twitter.User.current(user_callback); } else { twitter(#twitter-connect-placeholder).connectButton(); } }; function user_callback(currentUser) { screenName = currentUser.data('screen_name'); profileImage = currentUser.data('profile_image_url'); profileImageTag = img src=' + profileImage + '/; $('#twitter-connect-placeholder').innerHTML = Logged in as + profileImageTag + + screenName; }; Thanks, Andrew twitter.com/siggy_sf -- To unsubscribe, reply using remove me as the subject.
[twitter-dev] Re: @anywhere login code samples
I get 401 Unauthorized when I use this example code with my API key of course. On Apr 15, 6:08 am, siggy andrewseig...@gmail.com wrote: Hi there, Some of the @anywhere sample code in the Working with the current user section required some tweaks to get working. The text specifies a User Callback function but the sample code does not. Also, thetwttr.anywhere() function does not appear to work with an API key, instead I specify it with the anywhere.js file. Here is a modified code snippet that appears to work: //var anywhereApiKey = abcdefghi-123; //twttr.anywhere(anywhereApiKey, 1.0.0, onAnywhereLoad);twttr.anywhere(onAnywhereLoad); function onAnywhereLoad(twitter) { // Conditionally display theConnectButton based on current logged in state: if (twitter.isConnected) { twitter.User.current(user_callback); } else { twitter(#twitter-connect-placeholder).connectButton(); } }; function user_callback(currentUser) { screenName = currentUser.data('screen_name'); profileImage = currentUser.data('profile_image_url'); profileImageTag = img src=' + profileImage + '/; $('#twitter-connect-placeholder').innerHTML = Logged in as + profileImageTag + + screenName; }; Thanks, Andrew twitter.com/siggy_sf