Thanks for the replay Taylor,
My key is correct, what is strange to me is that this worked yesterday and today I haven’t changed any code related to the @anywhere api.
My
The key is correct and the tag is placed in the head of my page.
then we have.
twttr.anywhere(function (T) {
var currentUser,
screenName,
profileImage,
profileImageTag;
if(T.isConnected()){
currentUser = T.currentUser;
screenName = currentUser.data('screen_name');
profileImage = currentUser.data('profile_image_url');
profileImageTag = "<img src='" + profileImage + "' width='40' height='40'/>";
$("#tbox").append(profileImageTag + ' <span id="tUserText">Logged in as ' + screenName + ': <a href="" id="tSignOut">Sign out of Twitter?</a></span>');
T("#tbox").tweetBox({
counter: true,
height: 90,
width: 370,
label: "Tweet this GRUDG™?",
defaultContent: "<? echo $displayText; ?>",
onTweet: function(){
$.ajax({
url: '<?php echo CALLBACK_URL; ?>services/ajax.php?action=count_tweet',
data: { uid: uid, session: '<? echo json_encode($fbSession); ?>' },
success: function(data){
if(data == 'OK'){
$('#twitterBox').hide();
parent.$('#alertOverlay').fadeOut('slow').remove();
$.ajax({
url: '<? echo CALLBACK_URL; ?>services/ajax.php?action=refresh_get_immunity',
data: { uid: '<? echo $uid; ?>' },
success: function(data){
parent.doImmunity(data);
}
});
}else{
$(this).html(data);
}
}
});
}
});
$("#tSignOut").bind("click", function () {
twttr.anywhere.signOut();
$('#twitterBox').hide();
parent.$('#alertOverlay').fadeOut('slow').remove();
$.ajax({
url: '<? echo CALLBACK_URL; ?>services/ajax.php?action=refresh_get_immunity',
data: { uid: '<? echo $uid; ?>' },
success: function(data){
parent.doImmunity(data);
}
});
});
}else{
T("#tconnect").connectButton({
authComplete: function(user) {
$("#tconnect").hide();
T("#tbox").tweetBox({
counter: true,
height: 90,
width: 370,
defaultContent: "<? echo $displayText; ?>",
onTweet: function(){
$.ajax({
url: '<?php echo CALLBACK_URL; ?>services/ajax.php?action=count_tweet',
data: { uid: uid, session: '<? echo json_encode($fbSession); ?>' },
success: function(data){
if(data == 'OK'){
$('#twitterBox').hide();
parent.$('#alertOverlay').fadeOut('slow').remove();
$.ajax({
url: '<? echo CALLBACK_URL; ?>services/ajax.php?action=refresh_get_immunity',
data: { uid: '<? echo $uid; ?>' },
success: function(data){
parent.doImmunity(data);
}
});
}else{
$(this).html(data);
}
}
});
}
});
},
signOut: function() {
$('#tweetClose').click(function(){
parent.$('#alertOverlay').fadeOut('slow').remove();
$.ajax({
url: '<? echo CALLBACK_URL; ?>services/ajax.php?action=refresh_get_immunity',
data: { uid: '<? echo $uid; ?>' },
success: function(data){
parent.doImmunity(data);
}
});
});
}
});
}
});