TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 06-21-2008, 05:55 PM   #1 (permalink)
The Wanderer
 
Join Date: Jan 2008
Location: Nottingham
Posts: 7
Thanks: 1
Daniel is on a distinguished road
Default Ping.FM Wrapper Class

Ping.FM wrapper class

Version 0.2.1b

Download link: http://danltn.com/bin/b4g.phps
PHPClasses.org link: Browse the available classes - PHP Classes

This class allows you really easy interaction with the API features of Ping.FM. It also parses the XML return for easy access to the important data. (Accessible in $wrapper->details array)

Nothing too confusing about it, if you need more details check it on the Ping.FM API site, otherwise I can probably answer most questions.

Basic usage example:

PHP Code:
try
{
    
$wrapper = &new PingFM_Functions;
    
/** Create a new function call */
    
$wrapper->dev_api 'DEV_API';
    
/** Your dev API */
    
$wrapper->user_api 'USER_API';
    
/** Their user API */
    
if ( $wrapper->validate() ) /** If it validates */
    
{
        
/** Let's retrieve the last 3 messages for fun */
        
if ( $wrapper->latest(3'DESC') )
        {
            echo 
'Latest 3 message IDs: 'implode', 'array_keys($wrapper->details['messages']) ), '.';
            echo 
'<br />'"\n";
            
/** Show the array, just an example, you wouldn't really use this. */
        
}
        if ( 
$wrapper->post('status''is bored') ) /** Post to it */
        
{
            echo 
'Your status has been updated to "is bored."';
            
/** Another weird example */
        
}

    }
}
catch ( 
exception $e )
{
    echo 
$e->getMessage();

Enjoy, and any questions - just ask.

Last edited by Daniel : 06-21-2008 at 10:12 PM.
Send a message via MSN to Daniel
Daniel is offline  
Reply With Quote
The Following User Says Thank You to Daniel For This Useful Post:
wiifanatic (08-22-2008)
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 10:25 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design