The only sample code for php that I could find was the below:
I uploaded Services/Eventful.php into a test directory on the acct on
my hosted server.
I uploaded get_event.php into the test directory.
After playing with it and pieces clues together from the website, I
realize that this sample doesn't do what I want.
1) will Eventful.php work with php4? ( I'm not on a php5 server, yet)
2) where can I find examples to use the api in php to get all public
events for a zip code and then parrse them into some container that I
can manipulate in php?
I've studied the online documentation to enough to realize that if I
modify get_event.php to this:
<?
require 'Services/Eventful.php';
$app_key = '(my app key here)';
$user = null;
$password = null; (also tried = "")
$ev = &new Services_Eventful($app_key);
$args = array(
"location" => "75075",
"date" => "Future"
);
$event = $ev->call('events/search', $args);
if ( PEAR::isError($event) )
{
print("An error occurred: " . $event->getMessage() . "\n");
print_r( $ev );
}
print_r( $event );
?>
but I only get this error:
Parse error: syntax error, unexpected T_STRING, expecting
T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in
/home/(myDomain)/public_html/sandbox/Services/Eventful.php on line 80
Line 80 is the last line in :
class Services_Eventful
{
/**
* URI of the REST API
*
* @access public
* @var string
*/
public $api_root = 'http://api.eventful.com';
I don't know for sure that my host has provided these libraries:
require_once 'PEAR.php';
require_once 'HTTP/Request.php';
but I would assume so.
What am I doing wrong?
James