PHP Classes

File: example.php

Recommend this page to a friend!
  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: 14 years ago
Size: 1,067 bytes


Class file image Download
/* 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();

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

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