Inzwischen hab ich eine einigermassen gepflegte Kontaktliste, Google Contacts sei Dank. Früher hatte ich ein kleines Skript das über meine Datenbank gegangen ist und die heutigen und morgigen Geburtstage rausgesucht hat und per E-Mail verschickt hat. Hier mal die Version für Google Contacts/Calendar:
#!/bin/bash
TODAY=$(date +%Y-%m-%d) # 2010-03-30
TOMORROW=$(date --date=tomorrow +%Y-%m-%d)
TODAY2=$(echo ${TODAY} | cut -d "-" -f 2,3 )
TOMORROW2=$(echo ${TOMORROW} | cut -d "-" -f 2,3 )
YEAR=$(echo ${TODAY} | cut -d "-" -f 1 )
FOUND="false"
google calendar list --cal '.*birthday.*' --date ${TODAY},${TOMORROW} --field title | grep "^[^[]" | sed -e "s/'s birthday//g" > /tmp/file.txt
while read line; do
LASTNAME=$(echo $line | rev | cut -d " " -f 1 | rev)
BIRTHDAY=$(google contacts list "$LASTNAME" --fields birthday | grep "${TODAY2}\|${TOMORROW2}")
if [ "${BIRTHDAY}" != "" ]; then
BIRTHYEAR=$(echo ${BIRTHDAY} | cut -d "-" -f 1)
echo "${line}: ${BIRTHDAY} -> $(( ${YEAR} - ${BIRTHYEAR} )). Geburtstag"
FOUND="true"
fi
done < /tmp/file.txt
if [ "${FOUND}" == "false" ]; then
echo "no birthdays"
fi
rm /tmp/file.txt
Potthässlich, aber funktional. Man braucht dafür zwei Dinge
- https://code.google.com/p/googlecl/
- http://www.google.com/support/calendar/bin/answer.py?hl=en&answer=37098 -> More -> „Contacts‘ birthdays and events“
Wird bei mir per Cronjob aufgerufen und produziert dann beispielsweise sowas:
Peter Test: 1981-11-05 -> 29. Geburtstag Karlheinz Mustermann: 2009-11-06 -> 1. Geburtstag