Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

When something happens on my Linux server (low disk space, problems, etc.) I would like to know how could to automatically access Google Calendar and create an event in a specific calendar.

Is this possible?

share|improve this question
    
Don't forget to assign the bounty to an answer or it will disappear. –  Barry Mar 19 '11 at 10:18
    
sorry, I accepted the answer but did not figure out about the addtional bounty action (i thought just accepting would gave the bounty) –  Werner Mar 20 '11 at 11:10
    
Accepting the answer used to automatically award the bounty. The rules changed so that you can award bounties to answers other than your accepted answer. Thank you for awarding the bounty. Bounty FAQ –  Barry Mar 20 '11 at 11:19
add comment

2 Answers

up vote 1 down vote accepted
+100

Werner,

Using Google Calendar's API with JSON-C or ATOM seems to be a clean way to add events to your calendar. You may have to read up on how the authentication is processed, but the JSON code could be as simple as the following:


POST /calendar/feeds/default/private/full HTTP/1.1
Host: www.google.com 
Authorization: ... 
Content-Type: application/json
GData-Version: 2.0 
Content-Length: 233

{
 "data": {
   "title": "Tennis with Beth",
   "details": "Meet for a quick lesson.",
   "transparency": "opaque",
   "status": "confirmed",
   "location": "Rolling Lawn Courts",
   "when": [
     {
       "start": "2010-04-17T15:00:00.000Z",
       "end": "2010-04-17T17:00:00.000Z"
     }
   ]
 }
}

Here's the blog post that will help you to do just that.

share|improve this answer
    
great, thanks a lot! –  Werner Mar 20 '11 at 11:10
add comment

Depending upon what language you are comfortable with, Google's calendar API seems like the best way to go.

All you would have to do have a executable script in your preferred language (Python, PHP, Java), implement authentication using the API and create event.

I would probably run the script as a cron job as well.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.