| | |
Hoping for newbe help with this Zend script (Google API)
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Apr 2009
Posts: 34
Reputation:
Solved Threads: 0
Hi folks,
I am still quite new here, and brand new to Zend and PHP, so please forgive my ignorance...I'm sadly still very much a paint by numbers hack. :-D
I'm wanting to do what I think is a fairly simple task:
Collect info from one of my google calendars via the API and display that info in a table on a page on my website.
I have succesfully installed Zend and I have used this code to access my google calendar:
This gives me my default calendar information, but:
1) I want to be able to choose which calendar to display.
2) I want to be able to display the information in different columns, etc
Anyone able to point me in the right direction?
Thanks for your time!
Joel
I am still quite new here, and brand new to Zend and PHP, so please forgive my ignorance...I'm sadly still very much a paint by numbers hack. :-D
I'm wanting to do what I think is a fairly simple task:
Collect info from one of my google calendars via the API and display that info in a table on a page on my website.
I have succesfully installed Zend and I have used this code to access my google calendar:
<?php
// load library
require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
Zend_Loader::loadClass('Zend_Gdata_Calendar');
Zend_Loader::loadClass('Zend_Http_Client');
// create authenticated HTTP client for Calendar service
$gcal = Zend_Gdata_Calendar::AUTH_SERVICE_NAME;
$user = "EMAIL@GMAIL.COM";
$pass = "XXXXXXXXX";
$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $gcal);
$gcal = new Zend_Gdata_Calendar($client);
// generate query to get event list
$query = $gcal->newEventQuery();
$query->setUser('default');
$query->setVisibility('private');
$query->setProjection('basic');
// get and parse calendar feed
// print output
try {
$feed = $gcal->getCalendarEventFeed($query);
} catch (Zend_Gdata_App_Exception $e) {
echo "Error: " . $e->getResponse();
}
?>
<h1><?php echo $feed->title; ?></h1>
<?php echo $feed->totalResults; ?> event(s) found.
<p/>
<ol>
<?php
foreach ($feed as $event) {
echo "<li>\n";
echo "<h2>" . stripslashes($event->title) . "</h2>\n";
echo stripslashes($event->summary) . " <br/>\n";
echo "</li>\n";
}
echo "</ul>";
?>This gives me my default calendar information, but:
1) I want to be able to choose which calendar to display.
2) I want to be able to display the information in different columns, etc
Anyone able to point me in the right direction?
Thanks for your time!
Joel
![]() |
Similar Threads
- More than 100 google results with google API? (Python)
- Google API Search Engine Code (JavaScript / DHTML / AJAX)
- Google API in Web Services Application (Java)
- mapserver : GMaps API and custom maps (IT Professionals' Lounge)
- Utilizing google's api (HTML and CSS)
- Google Api Help. (Computer Science)
- Google API (Search Engine Optimization)
Other Threads in the PHP Forum
- Previous Thread: Notice: Undefined index: news_comments i
- Next Thread: How to Show Date like 13-Jul-2009
Views: 485 | Replies: 0
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic echo email encode error file files folder form forms function functions google howtowriteathesis href htaccess html image include insert integration ip java javascript joomla jquery limit link login loop mail menu methods mlm mod_rewrite multiple multipletables mysql oop parse paypal pdf php problem provider query radio random recursion regex remote script search select server sessions sms soap source space speed sql structure syntax system table template tutorial update updates upload url validation validator variable video web xml youtube





