2017 © Pedro Peláez
 

library twitter

Small TW Connector

image

mikke/twitter

Small TW Connector

  • Friday, May 9, 2014
  • by mikkezavala
  • Repository
  • 0 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

Twitter Connect

A Basic & Light Twitter Connector for Laravel 4.1, (*1)

Please contribute!, (*2)

I know there are a lot of packages for this, or library to do it, just i feel it is too much to include, to much process for the goal i had. Just simple as that, Connect, Authorize, Get User Data, my application does not need to push to tw, in the near future, i'll add more things!, (*3)

Installation

Using Composer composer., (*4)

You need to add the repo for the project first in your composer.json:, (*5)

    "repositories": [
        {
            "type":"vcs",
            "url": "https://github.com/mikkezavala/twitter.git"
        }
    ]

In the same require the package:, (*6)

    {
        "require": {
            "mikke/twitter": ">=0.0.4",
        }
    }

Then just run a composer update, (*7)

    $ composer update   

You can add the alias in your app/config/app.php, (*8)


'Twitter' => 'Mikke\Twitter\Twitter',

Usage

It can be called in your controller wherever you want, just this a quick example, conecting and getting back basic information, (*9)

You can create a config file, use existent one, or whatever you want to manage the keys, in my case i created a file called app/config/api.php and it looks like:, (*10)

File: app/config/api.php, (*11)


return array( 'twitter' => array( 'api_key' => 'XXXXXXXXXXXXXXX', 'api_secret' => 'XXXXXXXXXXXXXXXXXXXX', 'api_callback' => 'http://some.com/callback', 'api_token' => '', 'api_token_secret' => '', ) ); ```` File: app/routes.php ```php Route::get('/', function(){ $twitter = new TwitterConnect(Config::get('api.twitter')); $twitter->authorize(); }); Route::get('twitter/validate', function(){ Config::set('api.twitter.api_token', Input::get('oauth_token')); $twitter = new TwitterConnect(Config::get('api.twitter')); if($twitter->access_token(Input::get('oauth_verifier'))){ $data = $twitter->user_data(); print_r($data); } });

Contribute

This is just a simple connector, you can fork me, or contribute to this, the idea is this to make it easier, and collaborative, in the next week i'll be releasing more connectors, (*12)

The Versions

09/05 2014

dev-master

9999999-dev

Small TW Connector

  Sources   Download

The Requires

 

by Mikke Zavala

09/05 2014

0.0.7

0.0.7.0

Small TW Connector

  Sources   Download

The Requires

 

by Mikke Zavala

09/05 2014

0.0.6

0.0.6.0

Small TW Connector

  Sources   Download

The Requires

 

by Mikke Zavala

09/05 2014

0.0.5

0.0.5.0

Small TW Connector

  Sources   Download

The Requires

 

by Mikke Zavala

09/05 2014

0.0.4

0.0.4.0

Small TW Connector

  Sources   Download

The Requires

 

by Mikke Zavala

09/05 2014

0.0.3

0.0.3.0

Small TW Connector

  Sources   Download

The Requires

 

by Mikke Zavala