#!/bin/sh exec guile -s $0 "$@" # -*- scheme -*- !# ;; time-stamp: <2001-12-21 10:52:48 ttn> ;;; Copyright (C) 2000-2001 Thien-Thi Nguyen ;;; This program is provided under the terms of the GNU GPL, version 2. ;;; See http://www.fsf.org/copyleft/gpl.html for details. (define *proj-build-dir* "/home/ttn/build/guile-projects") (set! %load-path (cons *proj-build-dir* %load-path)) (use-modules (ttn cron) (ttn echo) (ttn slackful-concat) (proj-list db) (proj-list db-meta) (proj-list spewer)) (use-modules ((ttn html-world) :select (html-world.html-data)) ((ttn html-data) :renamer (symbol-prefix-proc '-))) (define (one-wurld name links) (list (number->string (length links)) " " name ;;; todo: accept numbers (-tt-pre (html-world.html-data links)))) (define concat (slackful-concat-proc 'string)) (use-modules ((ttn spewutils) :select (update-page!))) (define (write-wurlds.html) (update-page! "wurlds.html-data" "wurlds.html" echo) #t) ; blrf (use-modules ((ttn shellutils) :select (sysfmt))) (define (write-stats.txt) (sysfmt "~A/guile-projects-maint display-stats > stats.txt" *proj-build-dir*) (echo "wrote stats.txt")) (define (write-url-probe-stats.txt) (with-output-to-file "url-probe-stats.txt" (lambda () (db-connect) (echo (strftime "%Y-%m-%d %H:%M:%S UTC" (gmtime (current-time)))) (>>>url-probe))) (echo "wrote url-probe-stats.txt")) (define (*dl . items) (list "
\n" (map (lambda (item) (list "
" (car item) "
" (cdr item) (-p))) items) "
\n")) (define (*task-table . items) (-table (map (lambda (item) (-tr (list (-td (car item)) (-td (cdr item))))) items))) (define (update-index.html) (update-page! "index.html-data" "index.html" echo)) (exit (cron (command-line) ((hourly) (write-wurlds.html)) ((daily) (write-stats.txt) (update-index.html)) ((weekly) '(write-url-probe-stats.txt)))) ;;; .cron ends here