If you have the ability to install PEAR packages (type pear help
to verify), installation should be as simple as:
pear install http://api.eventful.com/libs/Services_EVDB.latest.tgz
If PEAR isn't available, follow these steps to install the package:
tar -xzvf Services_EVDB.latest.tgz
The EVDB API allows you to build tools and applications that interact with EVDB, the Events & Venues Database. This package provides a PHP interface to that API, including the digest-based authentication infrastructure.
See the API documentation at http://api.eventful.com for details.
require 'Services/EVDB.php'; // Enter your application key here. (See http://api.eventful.com/keys/) $app_key = 'change-this-application-key'; $evdb = &new Services_EVDB($app_key); // Authentication is required for some API methods. $user = $_REQUEST['user']; $password = $_REQUEST['password']; if ($user and $password) { $l = $evdb->login($user, $password); if ( PEAR::isError($l) ) { print("Can't log in: " . $l->getMessage() . "\n"); } } // All method calls other than login() go through call(). $args = array( 'id' => $_REQUEST['id'], ); $event = $evdb->call('events/get', $args); if ( PEAR::isError($event) ) { print("An error occurred: " . $event->getMessage() . "\n"); print_r( $evdb ); } // The return value from a call is an XML_Unserializer data structure. print_r( $event );
Services_EVDB()
Creates a new Services_EVDB object. Requires a valid app_key as provided by EVDB.
login()
Authenticates the given user and retrieves an authentication key from the EVDB API server. The authentication key is automatically passed to the server with each subsequent call()
.
call()
Calls the specified method with the given arguments and any previous authentication information (including app_key). Returns a data structure processed through XML_Unserializer.