2009-03-18 18:43:49 -04:00
|
|
|
! Copyright (C) 2009 Doug Coleman.
|
|
|
|
! See http://factorcode.org/license.txt for BSD license.
|
2009-03-18 18:45:33 -04:00
|
|
|
USING: db.tuples locals site-watcher site-watcher.db
|
2009-03-18 19:18:57 -04:00
|
|
|
site-watcher.private kernel db io.directories io.files.temp
|
|
|
|
continuations ;
|
2009-03-18 18:43:49 -04:00
|
|
|
IN: site-watcher.tests
|
|
|
|
|
2009-03-18 19:05:05 -04:00
|
|
|
: site-watcher-path ( -- path ) "site-watcher.db" temp-file ; inline
|
|
|
|
|
|
|
|
[ site-watcher-path delete-file ] ignore-errors
|
|
|
|
|
|
|
|
: with-sqlite-db ( quot -- )
|
|
|
|
site-watcher-path <sqlite-db> swap with-db ; inline
|
|
|
|
|
2009-03-18 18:43:49 -04:00
|
|
|
:: fake-sites ( -- seq )
|
|
|
|
[
|
|
|
|
account ensure-table
|
|
|
|
site ensure-table
|
|
|
|
watching-site ensure-table
|
|
|
|
|
|
|
|
"erg@factorcode.org" insert-account
|
2009-03-18 18:45:33 -04:00
|
|
|
"http://asdfasdfasdfasdfqwerqqq.com" insert-site drop
|
|
|
|
"http://fark.com" insert-site drop
|
2009-03-18 18:43:49 -04:00
|
|
|
|
|
|
|
"erg@factorcode.org" "http://asdfasdfasdfasdfqwerqqq.com" watch-site
|
|
|
|
f <site> select-tuples
|
|
|
|
] with-sqlite-db ;
|
|
|
|
|