Tuesday, January 11, 2011

Merging Two Google Calendars

I regularly use Mail for Exchange to sync my phone with my Google Calendar account. It's awfully useful but there's one catch : you can't set it up to sync with two google calendars. It'll always sync only your primary calendar.

Now, I have a personal calendar with entries for my classes etc. Apart from that, I have also subscribed to another public calendar for keeping track of the activities organized by various clubs of IISER Kolkata. But the default-calendar-only policy of Mail for Exchange meant I was unable to get the second calendar to sync with my phone.

I googled for finding some solution for the issue, but it didn't yield any useful information. I had almost given up when I came across a not so well-known service from google called Google Apps Script. As the name suggests, It lets you run scripts written in JavaScript on google's server and the script can access many of google's popular services, including calendar.

That solved my problem completely. All I needed was a script which will add all the events of the second calendar to the primary calendar, with some background checks to avoid adding duplicate entries. That was pretty easy: as per google's standards, the documentation was excellent, with ample examples too. So I had a working version of the script ready within very little time.

The code:

You can add triggers for the script as well. I added a daily trigger, so it will run once a day and sync the secondary calendar. Problem solved!

56 comments:

  1. This was really useful, thanks! Don't suppose you've updated this to remove events from your calendar that have been removed from the other calendar?

    Cheers,
    Rich

    ReplyDelete
  2. Great code, very useful - however it tends to duplicate full day events - would you have any indication as how to fix this?

    ReplyDelete
  3. The quick technical specifications of this gucci replica Phablet by LG may be compared by chanel replica Galaxy Note:139.6 x 90.4 x 8.5mm in resolution which makes it wider and thinner than Samsung Galaxy Note.5-inch replica handbags (1024 x 768) IPS display with 256 PPI screen density makes the Galaxy Note winner with just 3 inches hermes outlet. LG Optimus Vu would be available next month but with the uncertainty of price.

    A simple observer may find Optimus not so fendi outlet beautiful and stylish, as Galaxy rolex submariner replica Note is, but I find it a little better though gucci replica the users with aesthetic senses may love Galaxy Note to be the better choice.

    ReplyDelete
  4. I always love to read informative books and it sounds good to read your post where you are introducing some new books. I will buy these books and add them to my sleeping time study. All the students who are worried about writing assignments can Discover More Here as well as get their assignments prepared within deadlines and at cheap price.

    ReplyDelete
  5. Cool artical!)) Realy I like it! By the way, do you want to know about the best way in education? ! It is save your money and you mood! Essay help!) It is my secret!!!!

    ReplyDelete
  6. Awesome code! I have been trying on and off for a couple years now to write something like this. I modified it with an array to copy multiple calendars, but this is awesome!!! Thank you for sharing the code.
    I am going to look into adding support for deleting events deleted on the primary calendar. If I get that running I will put it on my blog and let you know.

    Thanks again!

    ReplyDelete
  7. Rankings thus strongly constrain their purposeful options, despite such actors being formally free to set their own courses of action. Yet these very practices then ensure the social reproduction of such structures as key universalizing models. buy custom essays online

    ReplyDelete
  8. Omega is an affluence watchmaker based out of
    louis vuitton replica Switzerland whose on the internet autograph are world-renowned for their adorableness and aloft top quality. Founded at La Chaux-de-Fonds, Switzerland in 1848 by Louis Brandt, Omega is beat by abounding of the lot of replica shoes affecting humans today. Presidents, actors and acclimatized icons are consistently aboveboard adorning their wrists with Omega watches. Louis Brandt initially bought places for gucci replica his key-wound assimilation abridged Replique Montre Rolex from belted craftsman. Afterwards his death, yet, his two sons acquainted a centralized adeptness action would after-effects academy aloft merchandise. This would serve as the alpha of Omega’s prominence. It was abandoned a abbreviate accumulated of time afterwards that the action became an industry regular.Each of Brandt’s sons, Louis-Paul and C?sar, anesthetized abroad in 1903 bequeathing their dior replica advantage to four youths (the oldest accepting 23). At this time, 240,000 watches had been produced celebration year by a agents of 800. The new owners, accepting their youth, affiliated to acclamation the accession and by the seventies, it had about-face into the third abettor of able watches aural the angel (and accumulated one accurate in Switzerland). Sad to say, Omega faced acerbic cyberbanking challenges throughout the bread-and-butter recession amidst 1975 and 1980 and had to become bailed out in 1981. There were talks of a abeyant get out from Seiko, a advancing watch manufacturer, but abolishment came to fruition. Rather, afterwards years of cyberbanking restructuring and accession mergers, the Swatch Group was formed in 1998 and is now the sole artisan of
    http://www.enjoywarwickshire.co.uk and added watch brands.





    ReplyDelete
  9. This is where the need for additional reading cloud-based technology becomes necessary. The school automation software is there to improve productivity providing all types of schools with smart and effective methods of administration

    ReplyDelete
  10. ralph lauren shirts, http://www.poloralphlaurenshirts.us.com/
    oakley, http://www.occhialioakleyoutlets.it/
    ray ban, http://www.occhiali-rayban.it/
    oakley outlet, http://www.oakleyoutlet.in.net/
    oakley sunglasses, http://www.oakleysunglasses-outlet.us.com/
    kobe bryant shoes, http://www.kobebryantshoes.in.net/
    pandora jewelry, http://www.pandorajewelryoutlet.us.com/
    cheap nike shoes, http://www.cheap-nikeshoes.cc/
    hollister uk, http://www.hollistershirts.co.uk/
    hermes belt, http://www.hermesbelts.us/
    cheap wedding dresses, http://www.cheap-weddingdresses.net/
    coach outlet canada, http://www.coachoutletcanada.com.co/
    cheap jordans, http://www.cheapjordanshoes.in.net/
    north face outlet, http://www.thenorthface.me/
    oakley sunglasses, http://www.oakleysunglassesdiscount.us.com/
    louis vuitton handbags, http://www.louisvuittonhandbags.org.uk/
    soccer jerseys, http://www.soccerjerseys.us.com/
    cheap nfl jerseys, http://www.cheapnfljerseys.org/
    juicy couture outlet, http://www.juicycoutureoutlet.net/
    the north face clearance, http://www.thenorthfaceclearances.us.com/
    chanel handbags, http://www.chanelhandbagsoutlet.in.net/
    yoga pants, http://www.yogapants.us.com/
    futbol baratas, http://www.futbol-baratas.com/
    prada handbags, http://www.pradahandbagsoutlet.co.uk/
    air jordan 13, http://www.airjordan13s.com/
    cai2015107

    ReplyDelete
  11. Google is a most famous and beneficent search engine and we can search sites by google easily for best assignment writing service of any other purpose. There are a lot of services of google and i am very thankful for services that provided us by google.

    ReplyDelete
  12. Get Latest Updates of Entertainment, News
    ALL the govt job, university exam, SSC , UPSC Results are available here, UP Police Recruitment, CG Police Job

    ReplyDelete
  13. I recently came across your blog and have been reading along. I thought I would leave my first comment. I don’t know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.I’ll use this information for my essays.

    ReplyDelete

  14. If you want to know What is National Cat Day and why is it celebrated by pet lovers all across the globe,
    just have a look at my blog.
    You too can celebrate this day with your loving pet cat.

    ReplyDelete
  15. To wish your beloved with glorious quotas,wonderful images in the New Year 2017.

    ReplyDelete
  16. This blog is so nice to me. I will continue to come here again and again. Visit my link as well. Good luck
    obat aborsi

    ReplyDelete
  17. This comment has been removed by the author.

    ReplyDelete
  18. I really thank you for the valuable info on this great subject and look forward to more great posts. Thanks a lot for enjoying this beauty article with me.

    geometry dash pc, geometry Dash, geometry dash lite, geometry dash play, geometry dash online

    ReplyDelete
  19. Mostly people have all the same things when they are writing academic task or any other writing, especially light music most people like during the writing.

    subway surf , baixar subway surf, subway surf download , download subway surf

    ReplyDelete
  20. You need to have time to take care of the active. It in fact was a amusement account it. Look advanced to far added agreeable from you.

    entrar hotmail agora , hotmail entrar, entrar hotmail , entrar no hotmail

    ReplyDelete
  21. Mostly people have all the same things when they are writing academic task or any other writing, especially light music most people like during the writing.
    facebook iniciar sesión , facebook, iniciar sesion , iniciar sesion facebook

    ReplyDelete
  22. Life becomes more interesting and wonderful when you share your memorable moments with friends and family through unique photographs. You can create your own unique style impressed with image editing software. And after hours of work stress you can also
    Download Musicas, Baixar Musicas Gratis ,Baixar Musicas Gratis, Baixar Musicas

    ReplyDelete
  23. Mostly people have all the same things when they are writing academic task or any other writing, especially light music most people like during the writing.
    dream league soccer download , dream league soccer apk , download dream league soccer , dream league soccer

    ReplyDelete
  24. Life becomes more interesting and wonderful when you share your memorable moments with friends and family through unique photographs. You can create your own unique style impressed with image editing software. And after hours of work stress you can also

    whatsapp messenger
    baixar whatsapp
    whatsapp plus
    download whatsapp
    whatsapp baixar

    ReplyDelete
  25. You need to have time to take care of the active. It in fact was a amusement account it. Look advanced to far added agreeable from you.

    baixar banana kong , banana kong , download banana kong , banana kong download , banana kong

    ReplyDelete
  26. Your blog posts are more interesting and impressive. I think there are many people like and visit it regularly, including me.I actually appreciate your own position and I will be sure to come back here.
    outlook iniciar sesión l iniciar sesión outlook l outlook l iniciar sesión

    ReplyDelete
  27. Nice! thank you so much! Thank you for sharing. Your blog posts are more interesting and impressive. I think there are many people like and visit it regularly, including me.I actually appreciate your own position and I will be sure to come back here.
    facebook entrar l entrar facebook l entrar no facebook l entrar facebook direto l entrar facebook agora

    ReplyDelete
  28. Thanks To Watch IPL 2017 Live Stream.One of the most entertaining cricket league IPL .to watch the live steaming click on link below

    Watch IPL 2017 Live Stream

    CRICKET LIVE SCORES
    IPL 2017 Points Table

    ReplyDelete
  29. I like to get up early to go out and breathe fresh air. I feel that it is good for health and a good habit
    19216811ll.com

    ReplyDelete
  30. I have read this above post its very nice for us thanks sharing ,great post.

    www.happywheelsy8.com

    ReplyDelete