dev-master
9999999-dev https://dev.twitter.com/This class is a union of 'abraham/twitteroauth' and 'ruudk/twitteroauth'.
MIT
The Requires
- php >=5.3.0
oauth twitter twitter oauth api twitter
Wallogit.com
2017 © Pedro Peláez
This class is a union of 'abraham/twitteroauth' and 'ruudk/twitteroauth'.
This class is a union of "abraham/twitteroauth"(owner), "ruudk/twitteroauth"(php 5.3 and namespaces) and (robhaswell/twitteroauth) (upload image)., (*1)
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
php composer.phar require --prefer-dist newerton/twitter-oauth "dev-master"
or add, (*4)
"newerton/twitter-oauth": "dev-master"
to the require section of your composer.json file., (*5)
Once the extension is installed, simply use it in your code by :, (*6)
<?php
use newerton\twitteroauth\TwitterOAuth;
/**
* Array with the OAuth tokens provided by Twitter when you create application
*/
$config = [
'consumer_key' => 'Consumer key',
'consumer_secret' => 'Consumer secret',
'oauth_token' => 'Access token',
'oauth_token_secret' => 'Access token secret'
];
/**
* Instantiate TwitterOAuth class with set tokens
*/
$tw = new TwitterOAuth($config);
//send update status
$response = $connection->post('statuses/update', ['status' => 'Posted by Class TwitterOAuth']);
//send update status with upload image
$file = realpath('./path/to/image/twitter.jpg');
$params = array(
'media[]' => "@{$file}",
'status' => 'Posted by Class TwitterOAuth'
);
$response = $connection->upload('statuses/update_with_media', $params);
This class is a union of 'abraham/twitteroauth' and 'ruudk/twitteroauth'.
MIT
oauth twitter twitter oauth api twitter