'consumerkey consumersecret',
//laissez un espace entre consumerkey et consumersecret
//exemple : 'référencement'=>'QWwfdSxzIgmJb8MstutTw 6OdDbWG9skbyKBmtbWPUaKrUqU1ChHgSZSWA5h893M',
//remplacer ci-dessous par vos applis
//////////////////////////////FIN MODIFICATIONS plus rien à modifier/////////////////////////////////////////
/* Clear PHP sessions */
if ($_REQUEST['test'] === 'clear') {/*{{{*/
session_unset();
session_destroy();
session_start();
}/*}}}*/
?>
';
if ($_POST['message']!='')
{
if ($_POST['reply_to']!='')
{
$reply_to="@".stripslashes($_POST['reply_to'])." ";
}
else
{
$reply_to="";
}
$reply_status_id=stripslashes($_POST['reply_status_id']);
$to = new TwitterOAuth($_SESSION['consumer_key'], $_SESSION['consumer_secret'], $_SESSION['access_key'], $_SESSION['access_secret']);
$to->OAuthRequest('https://twitter.com/statuses/update.xml', array('status' => $reply_to.stripslashes($_POST['message']),'in_reply_to_status_id' =>$reply_status_id), 'POST');
}
?>
http://$1 ", $text);
$text=preg_replace("/@([a-zA-z0-9_]+)/", "@
$1 ", $text);
$text=preg_replace("/#([a-zA-z0-9_]+)/", "#
$1 ", $text);
return $text;
}
function dateFormatting2($date){
$temp=strtotime($date);
$date=date("d M Y H:i", $temp);
return $date;
}
function getData2($timeline2){
global $username;
$preurl_user2="http://twitter.com/";
$preurl_tag2="http://search.twitter.com/search?q=";
$messages="";
$response=readXml2($timeline2);
$messages.='
Die letzten 30 Tweets an dich
';
foreach ($response as $status) {
$messages.= '
";
}
$messages.='
';
return $messages;
}
//envoyer un message direct
//$direct_message=$to2->OAuthRequest('http://twitter.com/direct_messages/new.xml', array('user' =>'seorobot','text' =>'Message test2'), 'POST');
//print_r($direct_message);
////////////////////////////////////////////////////////////////////////////////////////////////
echo '
';
if ($_POST['message']!='')
{
if ($_POST['reply_to']!='')
{
$reply_to="@".stripslashes($_POST['reply_to'])." ";
}
else
{
$reply_to="";
}
$reply_status_id=stripslashes($_POST['reply_status_id']);
$to = new TwitterOAuth($_SESSION['consumer_key'], $_SESSION['consumer_secret'], $_SESSION['access_key'], $_SESSION['access_secret']);
$to->OAuthRequest('https://twitter.com/statuses/update.xml', array('status' => $reply_to.stripslashes($_POST['message']),'in_reply_to_status_id' =>$reply_status_id), 'POST');
}
?>
Was machst du gerade ?
';
//TIMELINE
$to2 = new TwitterOAuth($_SESSION['consumer_key'], $_SESSION['consumer_secret'], $_SESSION['access_key'], $_SESSION['access_secret']);
//affichage timeline
//////////////////
if ($_GET[timeline]=="user") {
$user_timeline=$to2->OAuthRequest('http://twitter.com/statuses/user_timeline.xml', array('count'=>'30'), 'GET');
echo getData($user_timeline);
//print_r($user_timeline);
}
else {
$friends_timeline=$to2->OAuthRequest('http://twitter.com/statuses/friends_timeline.xml', array('count'=>'30'), 'GET');
echo getData($friends_timeline);
}
$friends_timeline=$to2->OAuthRequest('http://twitter.com/statuses/mentions.xml', array('count'=>'30'), 'GET');
echo getData2($friends_timeline);
//////////////////
//Fin affichage timeline
//SUPPRIMER MESSAGE
if ((isset($_GET[destroy]))&& ($_GET[destroy]!="")) {
$supp=$to2->OAuthRequest('http://twitter.com/statuses/destroy/'.strip_tags($_GET[destroy]).'.xml', array(), 'POST');
//print_r($supp);
}
//fin supprimer
//LIMITES appels API
//$limite_api=$to2->OAuthRequest('http://twitter.com/account/rate_limit_status.xml', array(), 'GET');
//print_r($limite_api);
//remaining-hits
}
?>