我正在为Eventbrite https://github.com/ryanjarvinen/eventbrite.php使用这个api。
它在ok中提取事件,但当有已知事件发布时,它会给我一个错误:
致命错误:没有异常‘异常’与消息‘找不到此用户事件’。在/home/davidhender/glasgowcitymission.davidhendersondesign.com/news-events/Eventbrite.php:109堆栈跟踪中:#0 /home/davidhender/glasgowcitymission.davidhendersondesign.com/news-events/events/eventbrite.php(17):Eventbrite->_/home/davidhender/glasgowcitymission.davidhendersondesign.com/news-events/events/eventbrite.php(17):_call(‘user_list_event.’),数组) #1 /home/davidhender/glasgowcitymission.davidhendersondesign.com/news-events/events/eventbrite.php(17):Eventbrite->user_list_events() #2 {main}在第109行的/home/davidhender/glasgowcitymission.davidhendersondesign.com/news-events/Eventbrite.php中抛出
<?php
// load the API Client library
include "../Eventbrite.php";
// Initialize the API client
// Eventbrite API / Application key (REQUIRED)
// http://www.eventbrite.com/api/key/
// Eventbrite user_key (OPTIONAL, only needed for reading/writing private user data)
// http://www.eventbrite.com/userkeyapi
$authentication_tokens = array('app_key' => 'UHH2XQAMZXTTZM526G',
'user_key' => '139627418395393246769');
$eb_client = new Eventbrite( $authentication_tokens );
// For more information about the features that are available through the Eventbrite API, see http://developer.eventbrite.com/doc/
$events = $eb_client->user_list_events();
//mark-up the list of events that were requested
// render in html - ?>
<style type="text/css">
.eb_event_list_item{
padding-top: 20px;
}
.eb_event_list_title{
position: absolute;
left: 220px;
width: 300px;
overflow: hidden;
}
.eb_event_list_date{
padding-left: 20px;
}
.eb_event_list_time{
position: absolute;
left: 150px;
}
.eb_event_list_location{
position: absolute;
left: 520px;
}
</style>
<h1>My Event List:</h1>
<?= Eventbrite::eventList( $events, 'eventListRow'); ?>发布于 2014-05-22 14:01:52
尝尝这个
<?php
try {
$events = $eb_client->user_list_events();
} catch ( Exception $e ) {
// Be sure to plan for potential error cases
// so that your application can respond appropriately
$events = array();
}
?>回显事件列表
<?= Eventbrite::eventList( $events, 'eventListRow'); ?>https://stackoverflow.com/questions/23808352
复制相似问题