Exemple #1
0
/* friends/ids */
$method = 'friends/ids';
twitteroauth_row($method, $twitter->get($method), $twitter->http_code);
/* friends/ids */
$method = 'friends/ids';
twitteroauth_row($method, $twitter->get($method), $twitter->http_code);
/**
 * Account Methods.
 */
twitteroauth_header('Account Methods');
/* account/verify_credentials */
$method = 'account/verify_credentials';
twitteroauth_row($method, $twitter->get($method), $twitter->http_code);
/* account/rate_limit_status */
$method = 'account/rate_limit_status';
twitteroauth_row($method, $twitter->get($method), $twitter->http_code);
/* account/update_profile_colors */
$parameters = array('profile_background_color' => 'fff');
$method = 'account/update_profile_colors';
twitteroauth_row($method, $twitter->post($method, $parameters), $twitter->http_code, $parameters);
/* account/update_profile */
$parameters = array('location' => 'Teh internets');
$method = 'account/update_profile';
twitteroauth_row($method, $twitter->post($method, $parameters), $twitter->http_code, $parameters);
/**
 * OAuth Methods.
 */
twitteroauth_header('OAuth Methods');
/* oauth/request_token */
$oauth = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);
twitteroauth_row('oauth/reqeust_token', $oauth->getRequestToken(), $oauth->http_code);
Exemple #2
0
echo '<br><br>';
echo '<table border="1" cellpadding="2" cellspacing="0">';
echo '<tr>';
echo '<th>API Method</th>';
echo '<th>HTTP Code</th>';
echo '<th>Response Length</th>';
echo '<th>Parameters</th>';
echo '</tr><tr>';
echo '<th colspan="4">Response Snippet</th>';
echo '</tr>';


/**
 * Direct Message Methdos.
 */
twitteroauth_header('Direct Message Methods');

/* direct_messages/new */
$parameters = array('user_id' => $user->id, 'text' => 'Testing out @oauthlib code');
$method = 'direct_messages/new';
$dm = $connection->post($method, $parameters);
twitteroauth_row($method, $dm, $connection->http_code, $parameters);

/* direct_messages */
$method = 'direct_messages';
twitteroauth_row($method, $connection->get($method), $connection->http_code);

/* direct_messages/sent */
$method = 'direct_messages/sent';
twitteroauth_row($method, $connection->get($method), $connection->http_code);