~nobuto/+junk/ubuntu-jp-meeting-log

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash

mail_address='Ubuntu Japanese Local Community Team <ubuntu-jp@lists.ubuntu.com>'
usual_day='today'
usual_time='22:00'
usual_interval='1 week'

held_day="${HELD_DAY}"
held_time="${HELD_TIME}"
next_day="${NEXT_DAY}"
next_time="${NEXT_TIME}"

if [ -z "${held_day}" ]; then held_day="${usual_day}"; fi
if [ -z "${held_time}" ]; then held_time="${usual_time}"; fi

if [ -z "${next_day}" ]; then next_day="${held_day} +${usual_interval}"; fi
if [ -z "${next_time}" ]; then next_time="${usual_time}"; fi

held="${held_day} ${held_time}"
next="${next_day} ${next_time}"

date_subject="`date -d"${held}" +%F`"
date_header_held="`date -d"${held}" +'%-m/%-d(%a)の%-k:%M'`"
date_header_next="`date -d"${next}" +'%Y/%-m/%-d(%a)の%-k:%M'`"

digest="`wget -q --user-agent="" $(date -d"${held}" +'https://wiki.ubuntulinux.jp/IRCMeeting/%Y%m%d?action=raw') -O-`"
log_url=`date -d"${held}" +'http://irclogs.ubuntu.com/%Y/%m/%d/%%23ubuntu-jp.html'`

subject="#ubuntu-jp IRCミーティングの議事録 ${date_subject}"

body="${date_header_held}から#ubuntu-jpで行われたIRCミーティングの議事録です。
次回は${date_header_next}から行います。

${digest}

------------------------------------------------------------
ログ: ${log_url}
------------------------------------------------------------
IRCミーティングの詳細は
https://wiki.ubuntulinux.jp/IRCMeeting を参照してください。
------------------------------------------------------------

"

body="`echo "${body}" | sed -e s/%/%25/g -e s/,/%2C/g`"
thunderbird -compose to="${mail_address}",subject="${subject}",body="${body}"