1 min read
Rails: Parsing iCal calendar on a password-protected WebDAV server
It took me a little while, but I finally got this working. You’ll need the iCalendar plugin.
require 'icalendar'Â
def view_ical
 request = Net::HTTP::Get.new('/calendars/calendar.ics')Â
response = Net::HTTP.start('webdav.site.com') {|http|Â
request.basic_auth 'username', 'password'Â
response = http.request(request)Â
}Â
calendar_text = response.body
calendars = Icalendar.parse(calendar_text)Â
calendar = calendars.first
end
Related Posts
30 Jan 2024
Google Criticized for Privacy Issues
Ian ‘Hixie’ Hickson, a prominent figure in the Flutter community, has left Google. Despite not being as public as other contributors, …
25 Jan 2024
Llama 2 avoids errors by staying quiet, GPT-4 gives long, if useless, samples
The article discusses a study conducted by computer scientists at the University of California San Diego on the reliability and robustness of large …
19 Jan 2009
NoMethodError (undefined method `finder') with Engines and Rails 2.2
I was getting this error with Rails 2.2 when using ActionMailer.
NoMethodError (undefined method `finder’ for #ActionView::Base:0x34146fc)
It …
