Created
September 5, 2014 06:47
-
-
Save cawa87/19e4c7c94e258d812f33 to your computer and use it in GitHub Desktop.
Lastest tweets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$consumerKey = '--------------------'; | |
$consumerSecret = '----------------------'; | |
$accessToken = '-------------------------------------'; | |
$accessTokenSecret = '-----------------------------'; | |
$twitter = new \TwitterPhp\RestApi($consumerKey, $consumerSecret, $accessToken, $accessTokenSecret); | |
/* | |
* Connect as application | |
* https://dev.twitter.com/docs/auth/application-only-auth | |
*/ | |
$connection = $twitter->connectAsApplication(); | |
/* | |
* Collection of the most recent Tweets posted by the user indicated by the screen_name, without replies | |
* https://dev.twitter.com/docs/api/1.1/get/statuses/user_timeline | |
*/ | |
$lastest = $connection->get('/statuses/user_timeline', array('screen_name' => 'CawaKharkov', 'exclude_replies' => 'true', 'count' => 2)); | |
return ['lastestTweets' => $lastest]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment