Exemple #1
0
function updateTwitter($status)
{
    $oauth_token = gettwitterEmail();
    $oauth_token_secret = gettwitterPass();
    $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $oauth_token, $oauth_token_secret);
    $connection->format = 'xml';
    $connection->decode_json = FALSE;
    $connection->post('statuses/update', array('status' => "{$status}"));
    // check that everything went OK.
    // twitter returns a long string that contains the update when things
    // are ok.
    $result = $connection->response;
    if (eregi("Could not authenticate you", $result)) {
        echo " <img src=\"action_stop.gif\" border=\"0\" /> twitter error: " . $result . "<br />";
    } else {
        echo " <img src=\"icon_accept.gif\" border=\"0\" /> twitter updated. ";
    }
}
Exemple #2
0
<?php

include_once "header.php";
?>

<?php 
$numEntries = getIndexNum();
$cookie = $_COOKIE['mindof'];
$storedcookie = getCookie();
$twitter_update = gettwitterCheck();
$twitter_email = gettwitterEmail();
if (checkCookie()) {
    showUpdateForm();
}
if (checkCookie() && stripslashes($_POST['checksubmit'])) {
    $update = strip_tags($_POST['update']);
    addEntry($update);
    if ($twitter_update == 1 && strlen($twitter_email) > 0) {
        $twit_update = stripslashes($_POST['update']);
        updateTwitter($update);
    }
    echo " <img src=\"icon_accept.gif\" border=\"0\" /> mindof updated. ";
}
showEntriesIndex($numEntries);
echo "<a href=\"" . $siteUrl . "archive.php?pagenum=2\" class=\"box\">older &#187;</a>";
?>

<?php 
include_once "footer.php";
?>