2017 © Pedro Peláez
 

library twitter

Wrapper for Twitter API using Guzzle

image

hampel/twitter

Wrapper for Twitter API using Guzzle

  • Wednesday, July 10, 2013
  • by hampel
  • Repository
  • 0 Watchers
  • 0 Stars
  • 306 Installations
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 2 % Grown

The README.md

Hampel Twitter

A Twitter API wrapper using Guzzle, (*1)

By Simon Hampel., (*2)

Installation

The recommended way of installing Hampel Twitter is through Composer:, (*3)

{
    "require": {
        "hampel/twitter": "dev-master"
    }
}

Usage

<?php

use Hampel\Twitter\Service\TwitterConfig;
use Hampel\Twitter\Service\TwitterService;
use Hampel\Twitter\Command\Statuses;

$config = new TwitterConfig();
$config->set("consumer key", "consumer secret", "token ", "token secret");
$oauth = new Guzzle\Plugin\Oauth\OauthPlugin($config->getOauthParamArray());
$client = new Guzzle\Http\Client();
$twitter = new TwitterService($client, $oauth);
$twitter->init();   

$application = new Application($twitter);
$data = $application->getRateLimit('application');
var_dump($data);

$statuses = new Statuses($twitter);
$data = $statuses->getUserTimeline(0, "twitterapi", "", 2);
var_dump($data);
$data = $statuses->getEarliestStatusId(0, "twitterapi");
var_dump($data);
$data = $statuses->getAllStatuses(0, "twitterapi");
var_dump(count($data));

$users = new Users($twitter);
$data = $users->getShowUser(0, "twitterapi");   
var_dump($data);
$data = $users->postLookupUsersByUserId(array('6253282', '783214'));
var_dump($data);
$data = $users->postLookupUsersByScreenName(array('twitterapi', 'twitter'));
var_dump(@data);

?>

Notes

Currently only application/rate_limit_status, statuses/user_timeline, users/show and users/lookup have been implemented., (*4)

TODO: implement more API calls!, (*5)

Unit Testing

Rename phpunit.xml.dist to phpunit.xml to set up unit testing, configure your Oauth parameters in the php section:, (*6)

<php>
    <const name="CONSUMER_KEY" value="consumer key goes here" />
    <const name="CONSUMER_SECRET" value="consumer secret goes here" />
    <const name="TOKEN" value="token goes here" />
    <const name="TOKEN_SECRET" value="token secret goes here" />
</php>

To run mock tests only and ignore network tests, run: phpunit --exclude-group network, (*7)

The Versions

10/07 2013

dev-master

9999999-dev https://bitbucket.org/hampel/twitter

Wrapper for Twitter API using Guzzle

  Sources   Download

MIT

The Requires

 

php guzzle twitter

10/07 2013

0.4.1

0.4.1.0 https://bitbucket.org/hampel/twitter

Wrapper for Twitter API using Guzzle

  Sources   Download

MIT

The Requires

 

php guzzle twitter

22/06 2013

0.4.0

0.4.0.0 https://bitbucket.org/hampel/twitter

Wrapper for Twitter API using Guzzle

  Sources   Download

MIT

The Requires

 

php guzzle twitter

19/06 2013

0.3.0

0.3.0.0 https://bitbucket.org/hampel/twitter

Wrapper for Twitter API using Guzzle

  Sources   Download

MIT

The Requires

 

php guzzle twitter

18/06 2013

0.2.0

0.2.0.0 https://bitbucket.org/hampel/twitter

Wrapper for Twitter API using Guzzle

  Sources   Download

MIT

The Requires

 

php guzzle twitter

17/06 2013

0.1.0

0.1.0.0 https://bitbucket.org/hampel/twitter

Laravel 4 wrapper for Twitter API using Guzzle

  Sources   Download

MIT

The Requires

 

php guzzle twitter