]> gitweb.factorcode.org Git - factor.git/blob - extra/site-watcher/email/email.factor
factor: trim using lists
[factor.git] / extra / site-watcher / email / email.factor
1 ! Copyright (C) 2009 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors arrays kernel namespaces smtp ;
4 IN: site-watcher.email
5
6 SYMBOL: site-watcher-from
7 site-watcher-from [ "factor-site-watcher@gmail.com" ] initialize
8
9 : send-site-email ( watching-site body subject -- )
10     [ account>> email>> ] 2dip
11     pick [
12         [ <email> site-watcher-from get >>from ] 3dip
13         [ 1array >>to ] [ >>body ] [ >>subject ] tri* send-email
14     ] [ 3drop ] if ;