<?
/*구글 캘린더를 통해 sms 발송*/
require_once 'Google/Calendar.php';
$ID='xxxxx@gmail.com';
$PW='xxx';
$startTime=date("Y-m-d\TH:i:s+09:00", time());
$endTime=date("Y-m-d\TH:i:s+09:00", time()+180);
$title='타이틀';
$content='설명';
$where='장소';
$service = new Google_Calendar;
if (!$service->requestClientLogin($ID,$PW)) {
exit("ClientLogin has failed\n".$service->getResponseBody());
}
$entry = <<<GDATA
<entry
xmlns="http://www.w3.org/2005/Atom"
xmlns:gd="http://schemas.google.com/g/2005">
<category
scheme="http://schemas.google.com/g/2005#kind"
term="http://schemas.google.com/g/2005#event">
</category>
<title type="text">$title</title>
<content type="text">$content</content>
<gd:where valueString="$where">
</gd:where>
<gd:when
startTime="$startTime"
endTime="$endTime">
<gd:reminder minutes='0' method='sms' />
</gd:when>
</entry>
GDATA;
if (!$service->insert($entry, "http://www.google.com/calendar/feeds/xxxxxxxxxxxxx@group.calendar.google.com/private/full")) {
exit("Inserting an entry has failed\n".$service->getResponseBody());
}
?>
이 파일이 필요함.
추가기능 밖에 없음.
xxxxxxxxxxxxx@group.calendar.google.com << 이부분은 캘린더ID
기본 캘린더를 쓰려면 default
참고로 캘린더ID는 여깄음.
출처:http://codepasta.net/50
http://www.rcdtokyo.com/etc/gdataapis/
댓글 없음:
댓글 쓰기