Question

This is my first post here at stackoverflow. My question is how to change the google calendar feed so that it only shows events for the current day automatically?

Basically what I want to do is output the feed onto a webpage that only shows events for today. The feed would change day by day. I've done something similar with other feeds (not google calendar) before except in those cases, I would be outputting the most recent "#" of posts. This wouldn't work if I were to show events for today only.

I've searched around on yahoo pipes and found a few where it filters the feed with a date that you have to input. This works except I want to be able to make it automatic instead of having someone input the date. Reading the google calendar feed api, there's also a date range I can do, but it's the same issue, I would have to specify the range by hand. Is there any way to automate that or some other alternative?

Is there some xslt magic I can do or something?

Thanks for the help!

Was it helpful?

Solution

You could do this in Yahoo Pipes:

  1. Fetch the iCal feed from your Google calendar. (As others have commented, the Atom feeds that Google calendar provides do not seem to contain the event date in a reasonably structured format.)
  2. Filter the feed based on DTSTART/DTEND values. You can use the Date Builder module to get current date, just enter "today" as the date.

An example pipe (shows only events starting within the next 24 hours):

iCal next 24 h

OTHER TIPS

this is given by the sample of gdata

private static void dateRangeQuery(CalendarService service,
  DateTime startTime, DateTime endTime) throws ServiceException,
  IOException {
CalendarQuery myQuery = new CalendarQuery(eventFeedUrl);
myQuery.setMinimumStartTime(startTime);
myQuery.setMaximumStartTime(endTime);

// Send the request and receive the response:
CalendarEventFeed resultFeed = service.query(myQuery,
    CalendarEventFeed.class);

System.out.println("Events from " + startTime.toString() + " to "
    + endTime.toString() + ":");
System.out.println();
for (int i = 0; i < resultFeed.getEntries().size(); i++) {
  CalendarEventEntry entry = resultFeed.getEntries().get(i);
  System.out.println("\t" + entry.getTitle().getPlainText());
}
System.out.println();

}

in which i think you can just set the minitime and maxtime to the same day?

What you do is set the url parameters for the atom feed -- start-min to today and start-max to tomorrow -- also, note you'll need to be authenticated in order for this to work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top