Skip to content

Instantly share code, notes, and snippets.

View jswelker's full-sized avatar

Josh Welker jswelker

  • Warrensburg, MO
View GitHub Profile
@jswelker
jswelker / gist:04997f378d9bc02311d2
Last active August 29, 2015 14:09
Google Calendar iCal parser demo for Rails
View gist:04997f378d9bc02311d2
#requires the following gems: net/http, chronic, icalendar, ice_cube
#for ice_cube, I had to use a branch that had not yet been pulled into master.
#In gemfile: gem 'ice_cube', :git => 'https://github.com/spra85/ice_cube.git'
class LibraryHoursCalendarBuilder
def get_hours
@calendars = LibraryHoursCalendar.all.order( "sort_order ASC" )
@calendars.each do |calendar|
#For each calendar, get the ical file from Google and parse it