dev-master
9999999-devTwitter Auth-Only API Consumer
MIT
The Requires
- php >=5.3.3
- kriswallsmith/buzz >=0.10
The Development Requires
by Josh Moody
Wallogit.com
2017 © Pedro Peláez
Twitter Auth-Only API Consumer
As of the 1.1 version of the Twitter REST API, all requests require OAuth., (*1)
On 11-Mar-2013, Twitter released Application-only authentication to allow requests on behalf of an APPLICATION, as opposed to on behalf of a specific USER., (*2)
This library implements the new authentication for public resources like user timelines., (*3)
See https://dev.twitter.com/docs/auth/application-only-auth for more info., (*4)
This library is installable via composer., (*5)
"require": {
"joshmoody/twitter-consumer": "dev-master"
},
// Get new instance of the twitter consumer.
$consumer = new joshmoody\Twitter\Consumer('your-consumer-key', 'your-consumer-secret);
// Fetch a joshmoody\Twitter\Response object
$response = $consumer->request('statuses/user_timeline.json?screen_name=joshmoody');
// Get the result as a stdclass object
$timeline = $timeline->result();
// ...or as RSS
$rss = $timeline->rss(array('feed_title'=>'Tweets from @username', 'feed_url' => 'http://yourdomain.com/path/to/rss/feed', 'feed_description'=>'My Tweets'));
// ...or as JSON encoded
$json = $timeline->json();
This package uses PHPUnit for unit testing. To run the unit tests, you'll need to install the dependencies using Composer:, (*7)
php composer.phar install --dev.
Then run the tests with vendor/bin/phpunit, (*8)
Twitter Auth-Only API Consumer
MIT