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
							 | 
						
					
						
							
								
									
										
										
										
											2009-04-07 04:04:25 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								continuations db.sqlite
							 | 
						
					
						
							
								
									
										
										
										
											2009-03-23 23:33:05 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								sequences tools.test ;
							 | 
						
					
						
							
								
									
										
										
										
											2009-03-18 18:43:49 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								IN: site-watcher.tests
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2009-03-23 23:33:05 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								[ "site-watcher.db" temp-file delete-file ] ignore-errors
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2009-03-18 18:43:49 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								:: fake-sites ( -- seq )
							 | 
						
					
						
							
								
									
										
										
										
											2009-03-23 23:33:05 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    "site-watcher.db" temp-file <sqlite-db> [
							 | 
						
					
						
							
								
									
										
										
										
											2009-03-18 18:43:49 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        account ensure-table
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        site ensure-table
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        watching-site ensure-table
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2009-03-25 12:20:21 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        "erg" "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
							 | 
						
					
						
							
								
									
										
										
										
											2009-03-23 23:33:05 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    ] with-db ;
							 | 
						
					
						
							
								
									
										
										
										
											2009-03-18 18:43:49 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2009-03-25 12:20:21 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								[ f ] [ fake-sites empty? ] unit-test
							 |