$tweet['title'],
"description" => $tweet['description'],
"url" => $tweet['url'],
"author" => $tweet['author']
);
$connection = ATASWP_Twitter::connect();
if ( $connection ) {
// process tweet
#### Twitter Cards work by pulling metadata information straight from a posted link.
#### You don't need tag to post link to Twitter.
$twitter_tweet = $tweet['title'] . ' ' . $tweet['url'];
$response = $connection->post('statuses/update', array('status' => $twitter_tweet));
}
return $response;
}
/**
* Twitter Tweet.
*
* @since 1.0.0
* @param string $tweet
* @return void $response
*/
public static function text_tweet( $tweet ) {
if ( empty( $tweet ) )
return;
global $wpdb;
$response = ''; // def
$connection = ATASWP_Twitter::connect();
if ( $connection ) {
// process tweet
#### Twitter Cards work by pulling metadata information straight from a posted link.
#### You don't need tag to post link to Twitter.
$response = $connection->post('statuses/update', array('status' => $tweet));
}
return $response;
}
/**
* Twitter verify credentials.
*
* @since 1.0.0
* @return object $user
*/
public static function verify_credentials() {
global $wpdb;
$connection = ATASWP_Twitter::connect();
$user = ''; // def
if ( $connection ) {
// you can now call all the methods on the twitteroauth/connection object
$user = $connection->get('account/verify_credentials');
}
return $user;
}
/**
* Twitter get configuration.
*
* @since 1.0.0
* @return object $configuration
*/
public static function get_configuration() {
$connection = ATASWP_Twitter::connect();
$configuration = ''; // def
if ( $connection ) {
// GET https://api.twitter.com/1.1/help/configuration.json
$configuration = $connection->get("help/configuration", []);
}
return $configuration;
}
}
?>