2017 © Pedro Peláez
 

library twitter-oauth

This class is a union of 'abraham/twitteroauth' and 'ruudk/twitteroauth'.

image

newerton/twitter-oauth

This class is a union of 'abraham/twitteroauth' and 'ruudk/twitteroauth'.

  • Saturday, May 3, 2014
  • by newerton
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6,072 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 11 % Grown

The README.md

TwitterOAuth

This class is a union of "abraham/twitteroauth"(owner), "ruudk/twitteroauth"(php 5.3 and namespaces) and (robhaswell/twitteroauth) (upload image)., (*1)

  • The directories are structured and the class uses PHP5.3 namespaces.
  • Included upload image using 'statuses/update_with_media' (robhaswell/twitteroauth).

Installation

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)

Usage

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);

The Versions

03/05 2014

dev-master

9999999-dev https://dev.twitter.com/

This class is a union of 'abraham/twitteroauth' and 'ruudk/twitteroauth'.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

oauth twitter twitter oauth api twitter