displaying Google Calendar events in a PHP Web site with XPath

Source: Internet
Author: User
Tags xpath drupal

Introduction: Google Calendar and other online calendar applications will provide a simple centralized system in which online communities can maintain an event calendar, and community members can get information about the latest events. But many organizations tend to display event calendars in their community portals, forums, or blogs. They often copy event calendar information from an online calendar application to a WEB site, reducing the efficiency of online centralized management of events. Google Calendar provides an integrated application interface (API) that provides a good solution to this problem. Learn how to extract and display Google Calendar data in your PHP Web site using XPath.

When I was a freelance web developer a few years ago, I developed a web portal written in PHP for a special car owner and enthusiast community (often called the Auto Club, which is very popular where I live). A few years before contacting me, some car club managers have learned basic web techniques and created a Web site of their own. As the site grows, the site accumulates a large number of pages, some of which publish separate event calendar information that have been invalidated. Because the primary purpose of the site is to inform the public and community members of the activity, the event calendar information is inserted in these pages.

Over time, the different snapshots of these community event calendars are not synchronized. Although many events have been in the past for a long time, the page still retains the sidebar associated with it. Even with proper management and effective Web design, maintaining individual copies of event calendar data in individual pages is a time-consuming and error-prone task. They found out that not the Car Club web site was working for them, but that they were working for that Web site themselves. They contacted me and wished I could show them a better way.

They want a forum where members of the club can discuss their favorite cars, and a central News page for the latest event reports and announcements. On this news page, they can notify an increasing number of members of events, such as get-togethers, driving to the wild and rural areas, and discussion of all members ' meetings on membership fees and budget matters. More importantly, they want to not have to maintain multiple event calendar replicas in various locations. You want to enter the event calendar in one place and access the information anywhere in the site.

Google Calendar and Google data APIs

Online calendar applications, such as Google calendar, provide a solution. By centralizing and managing events, Google Calendar users can share and maintain event calendars in one site, eliminating one of the sources that may cause errors in the event organization process. Community members can visit online days and always learn about the latest events and activities without causing confusion due to outdated event information on individual Web pages. It looks like the online calendar application is an ideal solution.

When developing the club's Web site with the Drupal Content management system (see Resources), I suggest that the club's managers use Google calendar to maintain the event calendar. Initially, the proposal was agreed and they were highly efficient because it was easy to use the Drupal Admin front end to update the event sidebar that I created for them. But over time, the club's success means that more events need to be advertised, and editing the event sidebar has become more cumbersome from easy and fun.

The Google data API and its access to Google Calendar event data provide a way out of this dilemma. The Google data API provides an implementation of the Atom Publishing Protocol (Atom Publishing Protocol,app), a Web service API for reading and updating various types of documents and information. There are Third-party integration APIs for microsoft®.net, Java™ programming languages, Python, and PHP that encapsulate most of the Google data API functionality in a set of object-oriented encapsulation classes.

After some research, I was able to extend the Auto club's Drupal site to the event sidebar, which will extract the latest event calendar data from the Google Calendar account, with the latest information.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.