PHP Classes

File: examples/twitter.php

Recommend this page to a friend!
  Classes of Daniel  >  ohmy-auth  >  examples/twitter.php  >  Download  
File: examples/twitter.php
Role: Example script
Content type: text/plain
Description: Example script
Class: ohmy-auth
Obtain authorization to access APIs using OAuth
Author: By
Last change: fixed some bugs with session handling and inheritance
added leg static function; organized http and sesssion code into components
Date: 10 months ago
Size: 1,039 bytes


Class file image Download
<?php require_once __DIR__ . '/../vendor/autoload.php';

 * Copyright (c) 2014, Yahoo! Inc. All rights reserved.
 * Copyrights licensed under the New BSD License.
 * See the accompanying LICENSE file for terms.

use ohmy\Auth1;

# initialize 3-legged oauth
$twitter = Auth1::legs(3)

# configuration
'key' => 'your consumer key',
'secret' => 'your consumer secret',
'callback' => 'your callback url'

# oauth flow

# test GET call
$twitter->GET('', array('count' => 5))
then(function($response) {

For more information send a message to info at phpclasses dot org.