View Single Post
Old 05-11-2009, 02:42 PM   #5 (permalink)
Jay
The Contributor
Good Samaritan 
 
Join Date: Dec 2007
Posts: 60
Thanks: 5
Jay is on a distinguished road
Default

Hehe, I changed the getInstance function..

@foobarph
There are a few PHP Twitter APIs out there, mine only adds to the bunch

@CoryMathews
Lemme know if you find any irregularities.. I tested each function after I made it to see that it worked, but I could have missed something..

PHP Code:
$twitter = new TwitterAPI('Username''Password'true'./twitter_cache'300);

if(
$twitter->verifyCredentials())
{
    
// It's your job to catch exceptions
    // All TwitterAPI exceptions are of type TwitterException
    // verifyCredentials() is the only function that won't raise an exception

    // the date format parameter is optional
    
$myTweets $twitter->getTweets('F jS, Y');

    
// gets all the tweets that mentioned you (@<you>)
    
$mentioned $twitter->getMentioned('F jS, Y');

    
// Auto-saving of the cache isn't implemented.. so we gotta call this to save it. Don't worry, if you haven't requested new data since the cache was written, no new cache will be saved :-P (it checks for $modified to be true)
    
$twitter->saveCache();
}
else
{
    print 
'Incorrect twitter credentials, yo.';

Jay is offline  
Reply With Quote