#!/usr/bin/mzscheme -qr ; ; sadvogato.scm - Quick script to post a new diary entry to advogato ; Copyright (C) 2002 MJ Ray markj at luminas.co.uk ; Licensed under the GNU GPL, see http://www.gnu.org/ (define user "") (define password "") (require (lib "xmlrpc.ss" "web-server") (lib "process.ss")) (define (yes-to? string) (display string) (char-ci=? #\y (car (string->list (read-line))))) (let* ((advogato (xml-rpc-server "advogato.org" 80 "/XMLRPC")) (authcookie ((advogato 'authenticate) user password)) (tmpfile "~/.followup")) (if (file-exists? tmpfile) (delete-file tmpfile)) (system (string-append (getenv "EDITOR") " " tmpfile)) (if (yes-to? "Really post that entry (y/n)? ") ((advogato 'diary.set) authcookie -1 (read-string 999999 (open-input-file tmpfile)))))