Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Robert Pitt  >  Twitter API  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: This is the example file for the Twitter API
Class: Twitter API
Set or get information from a Twitter user account
Author: By
Last change:
Date: 5 years ago
Size: 1,067 bytes
 

Contents

Class file image Download
<?php
/*    Example.php V1.0.0 (Example showing the methods available)
*
**    Simple Twitter API Based on PHP5 OOP
***   Version 1.0.0
****  Created by Robert Pitt
***   Licence GPL - General Public Licence
**    Copyright 2009, Robert Pitt
*
*/

//Load the core includes
include 'Twitter/Twitter.php';

$Twitter = new Twitter('username','password'); // this will set the credentials used throughout the twitter api

//echo $Twitter->Timeline->public_timeline();
//echo $Twitter->Timeline->friends_timeline(array('count' => 20));
//echo $Twitter->Timeline->user_timeline();
//echo $Twitter->Timeline->mentions();

//Statuses
//echo $Twitter->Status->show("Some id");
//echo $Twitter->Status->update(array('status' => "Testing the new api system."));
//echo $Twitter->Status->destroy(776676041);

//Users
//echo $Twitter->Users->show('cornetofreak');
//echo $Twitter->Users->search(array('q' => 'eminem'));
//echo $Twitter->Users->friends(array('user_id' => '756278'));
//echo $Twitter->Users->followers(array('user_id' => 1401881));
?>