Happy Birthday! mail send to friend at birthday.
誕生日おめでとうメールを友達に送る物です.
たまに送ると割と喜ばれたりするので,機械的に送ってしまえばずっと喜ばれるわけですから,「あぁこれはいいなぁ」と思ったりするわけです.
gem install sinatra haml sequel sqlite3-ruby tlsmail
まず,次の設定ファイルを自分用に修正してください.
lib/mail/mail.yml
その後は,
ruby server.rb
このコマンドを叩けば,友人の誕生日を管理するWEBアプリが立ち上がります.好きなだけ友人を登録すればいいですよ.
bin/happy_birthday_mail
このコマンドを叩けば,今日,誕生日の友人にお祝いメッセージを送りますよ.めでたいですね.
毎日コマンドを叩くのはやってられないので,通常は cron か anacron に以下のコマンドを登録しておきましょう.
crontab -e
もしくは
/etc/anacrontab
を編集しましょう.
設定例
#cron # m h dom mon dow command 0 10 * * * ~/apps/happy_birthday_mail/bin/happy_birthday_mail #anacron 1 60 cron.birthday.daily ~/apps/happy_birthday_mail/bin/happy_birthday_mail