Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 67efb19c46
Fetching contributors…

Cannot retrieve contributors at this time

23 lines (16 sloc) 0.483 kb
#!/usr/bin/env ruby
require 'vpim/vcard'
require 'vpim/icalendar'
$in = ARGV.first ? File.open(ARGV.shift) : $stdin
$out = ARGV.first ? File.open(ARGV.shift, 'w') : $stdout
cal = Vpim::Icalendar.create
Vpim::Vcard.decode($in).each do |card|
if card.birthday
cal.push Vpim::Icalendar::Vevent.create_yearly(
card.birthday,
"Birthday for #{card['fn'].strip}"
)
$stderr.puts "#{card['fn']} -> bday #{cal.events.last.dtstart}"
end
end
puts cal.encode
Jump to Line
Something went wrong with that request. Please try again.