guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

random-indymedia.cgi


From: Thien-Thi Nguyen
Subject: random-indymedia.cgi
Date: Sun, 27 Oct 2002 23:07:28 -0800

munge PATH to taste.

thi


____________________________________
#!/bin/sh
# -*- scheme -*-
PATH=/home/ttn/local/bin:/usr/local/bin:$PATH
exec guile -s $0 "$@"
!#
;;; random-indymedia.cgi

;; Copyright (C) 2002 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 *indymedia* `(,@(map (lambda (stem)
                               (format #f "http://~A.indymedia.org"; stem))
                             '(adelaide
                               alberta
                               argentina
                               arizona
                               athens
                               atlanta
                               austin
                               austria
                               baltimore
                               barcelona
                               belgium
                               bolivia
                               boston
                               brasil
                               brazil
                               brisbane
                               bristol
                               buffalo
                               cfl
                               chapelhill
                               chiapas
                               chicago
                               chile
                               climate
                               colombia
                               cyprus
                               dc
                               docs
                               ecuador
                               eugene
                               euskalherria
                               germany
                               global
                               hamilton
                               houston
                               india
                               ireland
                               italy
                               ithaca
                               jakarta
                               jerusalem
                               la
                               lists
                               madison
                               madrid
                               maine
                               maritimes
                               melbourne
                               mexico
                               milwaukee
                               mke
                               montreal
                               mumbai
                               newjersey
                               newmexico
                               nigeria
                               nyc
                               nycap
                               ontario
                               ottawa
                               portland
                               prague
                               print
                               process
                               pt
                               quebec
                               radio
                               richmond
                               rochester
                               rockymountain
                               russia
                               sandiego
                               santacruz
                               satellite
                               seatlle
                               seattle
                               sf
                               southafrica
                               stlouis
                               sweden
                               switzerland
                               sydney
                               tech
                               thessaloniki
                               thunderbay
                               twincities
                               uk
                               urbana
                               uruguay
                               utah
                               vancouver
                               vermont
                               victoria
                               volunteer
                               windsor
                               www))
                      ,@(map (lambda (stem)
                               (format #f "http://~A"; stem))
                             '(www.indymedia.org.il
                               www.indymedia.org.nz
                               www.indymedia.org.uk
                               brisbane.indymedia.org.au
                               indymedia.org.il))))

(use-modules ((ttn html-data) :renamer (symbol-prefix-proc '-))
             ((ttn flatten) :select (flatten)))

(define (pick-one ls)
  (list-ref ls (random (length ls))))

(set! *random-state* (seed->random-state (current-time)))

(let ((suggested (pick-one *indymedia*)))
  (flatten (cons "Content-type: text/html\n\n"
                 (-html (-head (-title suggested)
                               (-refresh "0" suggested))
                        (-body (-href suggested suggested))))))

;;; random-indymedia.cgi ends here




reply via email to

[Prev in Thread] Current Thread [Next in Thread]