Using GCALCLI to access Google Calendar



So, I had a netbook lying around, an old ASUS SURF 4G, and thought "hey, it would be cool to look my calendar on this, and make a key hanger with it's screen". So I thought, ok, I will let the browser open in google calendar and run to the street to find something to build the key hanger. Unfortunately, my ASUS has only 4GB SSD HD, so right now it's loaded with a custom Gentoo that will never update, that I've built long ago. This custom Gentoo runs an old Opera Browser. And my Opera Browser can load everything, except Google Calendar.

So I should just stop here and go outside walk on the beach... Nah, I HAVE to fix this. So how? Doing some Google Search I've discovered that there is a command line way of getting the calendar, using a python script called gcalcli. I have Python 2.7.1 already built into, so it's easy right? Uhm, wait, it depends on other things... Ok, no problem, just download everything with Pip. Oh, Pip is not Installed?

Ok. Run this:

 curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py  
 python get-pip.py  

Then you need to get Google API Client for Python. Type this:

 pip install --upgrade google-api-python-client  

Now you need python-dateutil. Go pip:

 pip install python-dateutil  

and vobject and parsedatetime Python module. It's time for:

 pip install vobject  
 pip install parsedatetime  

Ok, now you are prepared. Right now, all you need to do is download gcalcli:

 curl -O https://raw.github.com/insanum/gcalcli/master/gcalcli  

And if everything is fine, just make it executable:

 chmod +x gcalcli  

Now you can run it.

 ./gcalcli agenda  

Everything should be self-explanatory from here on. You can't validate the Oauth2 through links because Google will ask for javascript before giving you the authentication code. With gcalcli you can do much more than just seeing your agenda. Have fun accessing Google Calendar from the command line.

Powered by Blogger.