delete() public method

DELETE wrapper for oAuthReqeust.
public delete ( $url, $parameters = [] )
Beispiel #1
0
twitteroauth_row('statuses/retweets_of_me', $connection->get('statuses/retweets_of_me'), $connection->http_code);
/**
 * Status Methods.
 */
twitteroauth_header('Status Methods');
/* statuses/update */
date_default_timezone_set('GMT');
$parameters = array('status' => date(DATE_RFC822));
$status = $connection->post('statuses/update', $parameters);
twitteroauth_row('statuses/update', $status, $connection->http_code, $parameters);
/* statuses/show */
$method = "statuses/show/{$status->id}";
twitteroauth_row($method, $connection->get($method), $connection->http_code);
/* statuses/destroy */
$method = "statuses/destroy/{$status->id}";
twitteroauth_row($method, $connection->delete($method), $connection->http_code);
/* statuses/retweet */
$method = 'statuses/retweet/6242973112';
twitteroauth_row($method, $connection->post($method), $connection->http_code);
/* statuses/retweets */
$method = 'statuses/retweets/6242973112';
twitteroauth_row($method, $connection->get($method), $connection->http_code);
/**
 * User Methods.
 */
twitteroauth_header('User Methods');
/* users/show */
$method = 'users/show/27831060';
twitteroauth_row($method, $connection->get($method), $connection->http_code);
/* users/search */
$parameters = array('q' => 'oauth');
Beispiel #2
0
twitteroauth_row('statuses/retweets_of_me', $twitter->get('statuses/retweets_of_me'), $twitter->http_code);
/**
 * Status Methods.
 */
twitteroauth_header('Status Methods');
/* statuses/update */
date_default_timezone_set('GMT');
$parameters = array('status' => date(DATE_RFC822));
$status = $twitter->post('statuses/update', $parameters);
twitteroauth_row('statuses/update', $status, $twitter->http_code, $parameters);
/* statuses/show */
$method = "statuses/show/{$status->id}";
twitteroauth_row($method, $twitter->get($method), $twitter->http_code);
/* statuses/destroy */
$method = "statuses/destroy/{$status->id}";
twitteroauth_row($method, $twitter->delete($method), $twitter->http_code);
/* statuses/retweet */
$method = 'statuses/retweet/6242973112';
twitteroauth_row($method, $twitter->post($method), $twitter->http_code);
/* statuses/retweets */
$method = 'statuses/retweets/6242973112';
twitteroauth_row($method, $twitter->get($method), $twitter->http_code);
/**
 * User Methods.
 */
twitteroauth_header('User Methods');
/* users/show */
$method = 'users/show/27831060';
twitteroauth_row($method, $twitter->get($method), $twitter->http_code);
/* users/search */
$parameters = array('q' => 'oauth');
Beispiel #3
0
/* 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);

/* direct_messages/sent */
$method = "direct_messages/destroy/{$dm->id}";
twitteroauth_row($method, $connection->delete($method), $connection->http_code);



/* Some example calls */
//$connection->get('users/show', array('screen_name' => 'abraham'));
//$connection->post('statuses/update', array('status' => date(DATE_RFC822)));
//$connection->post('statuses/destroy', array('id' => 5437877770));
//$connection->post('friendships/create', array('id' => 9436992));
//$connection->post('friendships/destroy', array('id' => 9436992));

/* Include HTML to display on the page */
include('html.inc');