views:

670

answers:

1

So, my problem is as such...

I'm building a simple calendar module for my company's intranet portal. We use Google (Apps for your Domain) Calendar and I'd like to give the employees the ability to see all the feeds they've subscribed to in one calendar--just like on the real Google Calendar!

The reason I'm not just using the the gadget they provide is because we'd like a single week view. Their gadget currently only offers full month and 'week agenda' views. So, we'd like a week-view that basically just looks like one row (week) from the full calendar. We've made such an interface, now we just need to populate it.

I can get it to work with one feed. Heck, I can even get it to work with all the feeds a user has subscribed to. The problems is that it's sslllooowwwww. From what I can tell , the only way I can get all the events from every feed that a person is subscribed to is to loop through their list of feeds and make a new call to Google asking for the events for each feed. Well, naturally, if a person is subscribed to, say, 12 feeds... it's going take a long time.

One idea that could help with the speed problem is to store the results in our database and update it occasionally for each of our 100's of feeds. But, that will probably slow our servers down because it basically will be constantly querying Google due to the number of feeds and time it takes to retrieve each one.

Question: Is there a way to ask for all the events from a list of feeds instead of querying individually for each one? Any help would be greatly appreciated.

By the way, I'm using PHP and the Zend Gdata standalone library.

Thanks in advance.

+1  A: 

I have investigated techniques for doing this and found an interesting approach that people are using with Yahoo Pipes. Check out OUseful.info and bavatuesdays for details. I'm not sure that this would necessarily solve your speed issue though.

If I were doing this in Java I'd use an executor to process all of the users feed requests simultaneously.

Perhaps there is something that you can do using ETags and caching? In this section of Google's Calendar API Developer's Guide it shows the etag attribute being returned for each entry in the listing of the user's calendars. That value can be used to cache the calendar. Whenever the etag for a particular calendar dhanges, the calendar needs to be refreshed with a new request. That could save you quite a bit of bandwidth. Hopefully the Zend GData API exposes those elements to client code.

laz
Thanks for responding. I've actually never heard of Yahoo! Pipes. Regardless of its usefulness for this project, it could be useful for other things. Also the etags element looks intriguing. I'll investigate. Again, thanks.
KyleFarris