Tweets

$twitter = new BirdElephant($credentials);

$tweets = $twitter->tweets();

Tweet

Tweets a tweet object, with media or a poll. Can quote retweet and reply to tweets. See Compose Tweets for full implementation details and examples;

$tweets->tweet($tweet);
NameTypeDescription
$tweetobjectThe Tweet object - see Manage Tweetsrequired

Delete Tweet

Deletes a tweet on behalf of the authenticated user

$tweets->delete($tweet_id);
NameTypeDescription
$tweet_idStringThe Tweet idrequired

Get Tweet

Gets a tweet

$tweets->get($tweet_id, $params);
NameTypeDescription
$tweet_idStringThe Tweet idrequired
$paramsArrayQuery Parametersoptional

Lookup Tweets

Gets multiple tweets

$tweet_ids = [$id1,$id2]
$tweets->lookup($tweet_ids, $params);
NameTypeDescription
$tweet_idsArrayThe Tweet idsrequired
$paramsArrayQuery Parametersoptional

Count Recent Tweets

Gets a count of Tweets that match a query in the last 7 days.

$params = [
    'query' => 'Schlager',
];

$tweets->count()->recent($params);
NameTypeDescription
$paramsArrayQuery Parametersrequired

Count All Tweets

Gets a count of Tweets that match a query. Academic track only.

$params = [
    'query' => 'Dieter Thomas Heck',
];

$tweets->count()->all($params);
NameTypeDescription
$paramsArrayQuery Parametersrequired

Search Recent Tweets

Search Tweets that match a query in the last 7 days.

$params = [
    'query' => 'limerick has:images ',
    'tweet.fields' => 'attachments,author_id,created_at',
    'expansions'   => 'attachments.media_keys',
    'media.fields' => 'public_metrics,type,url,width',
    'max_results'  => 10,
];

$tweets->search()->recent($params);
NameTypeDescription
$paramsArrayQuery Parametersrequired

Search All Tweets

Search Tweets that match a query. Academic track only.

$params = [
    'query' => 'Schlager has:images',
];

$tweets->search()->all($params);
NameTypeDescription
$paramsArrayQuery Parametersrequired

Hide Reply

Hide a reply to a tweet

// note: you can't hide your own replies!!
$tweets->reply()->hide($id);
NameTypeDescription
$idStringThe Tweet idrequired

Unhide Reply

unhide a reply to a tweeet

$tweets->reply()->unhide($id);
NameTypeDescription
$idStringThe Tweet idrequired

Tweet Likers

Get the users who have liked a given tweet

$tweets->likers($tweet_id, $params);
NameTypeDescription
$tweet_idStringThe Tweet idrequired
$paramsArrayQuery Parametersoptional

Tweet Retweeters

Get the users who have liked a given tweet

$tweets->retweeters($tweet_id, $params);
NameTypeDescription
$tweet_idStringThe Tweet idrequired
$paramsArrayQuery Parametersoptional
Edit this page on GitHub Updated at Tue, Jan 3, 2023