0
iCalendar gem을 사용하여 iCal file에서 이벤트를 가져 오는 rake 태스크 설정이 있습니다. iCal에는 표준 .ics 필드 외에도 여러 개의 사용자 정의 필드가 있습니다. 그 값들을 가져올 수 있습니까? 나는 문제없이 처리 할 수있는 iCal의 파일이 같은Ruby/Rails 레이크 태스크를 통해 사용자 정의 필드로 iCalendar를 구문 분석
라인 :이 문제는이 같은 라인에 대한 발생
DESCRIPTION:The lions and tigers are on exhibit.
: 나는 정의를 참조 할 방법
X-TRUMBA-CUSTOMFIELD;NAME="Event Location";ID=10831;TYPE=SingleLine:Lower Level\,
across from the Stars and Stripes Cafe
을 "이벤트 위치 " 들?
desc "Import events from Smithsonian"
task :smithsonian => :environment do
url = "http://www.trumba.com/calendars/smithsonian-events.ics"
cals = Icalendar.parse(open(url))
cal = cals.first
cal.events.each do |event|
e = TempEvent.find_or_create_by_name(
:name => event.summary.to_s,
:description => event.description.to_s,
:starts_at => event.dtstart.to_s,
:ends_at => event.dtend.to_s,
:tag_list => event.categories,
:url => event.url,
:facebook_url => "https://www.facebook.com/Smithsonian",
:twitter_url => "https://twitter.com/smithsonian",
:venue_name => "Smithsonian",
:external_id => event.uid.to_s,
:source => "Smithsonian iCal import",
:published => true)
end
end