My favorites | Sign in
Project Home Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
include "lib/Import.class.php";

$CalendarID = "id@group.calendar.google.com";
$Username = "username";
$Password = "password";

// Login to Google service
$Import = new Import($Username, $Password);



// Define some templates (map event attributes to Google event attributes)
$Import->Title = "</staffel/spiel/teamheim> - </staffel/spiel/teamgast> (</staffel/liganame>)";
$Import->Location = "</staffel/spiel/teamheim>, </staffel/spiel/halle>";
$Import->Start = "</staffel/spiel/datum> </staffel/spiel/uhrzeit>";
$Import->Duration = 120; // 2 hours
$Import->UniqueKey = "</staffel/spiel/datum> </staffel/spiel/uhrzeit> </staffel/spiel/halle>";

// Add some reminders
$Import->AddReminder(Import::REMINDER_POPUP, Import::REMINDER_ONE_DAY * 3);

// Read XML file containing data for events
$Import->Read("http://www.volleyball-nordbaden.de/xml_export/spiele_1665.xml");

// Add events to Google calendar
$Number = $Import->Add("http://www.google.com/calendar/feeds/$CalendarID/private/full", "//spiel", Import::CONFLICT_SHIFT);

echo "Imported $Number events!";
?>

Change log

r7 by daniel.morlock on Sep 26, 2010   Diff
Cleaned up project
Go to: 
Project members, sign in to write a code review

Older revisions

r6 by daniel.morlock on Sep 26, 2010   Diff
Modified importer to support more
sources i.e. XML files
r5 by daniel.morlock on Sep 9, 2009   Diff
Some minor changes.
r4 by daniel.morlock on Sep 9, 2009   Diff
lib/Match.php moved to
lib/Match.class.php. Further I added
VSG-2009.db as an example database.
All revisions of this file

File info

Size: 1069 bytes, 30 lines
Powered by Google Project Hosting