From 8ea70047e07b4042b26c47993e3ee6eadb690f0b Mon Sep 17 00:00:00 2001 From: Brent Gordon Date: Tue, 17 Mar 2020 09:01:12 -0500 Subject: [PATCH] minor fixes --- bot.rkt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bot.rkt b/bot.rkt index dd1e745..28f4455 100644 --- a/bot.rkt +++ b/bot.rkt @@ -12,7 +12,7 @@ (define CRLF "\r\n") (define boundary (bytes->string/utf-8 (md5 (number->string (current-seconds))))) (define boundary-line (string-append "--" boundary CRLF)) -; a table to map file extensions to MIME types: +; a hashtable mapping file-extensions and their mime types (define ext=>mime-type #hash(("jpg" . "image/jpeg") ("png" . "image/png") @@ -60,6 +60,7 @@ (define (upload-attachment) (define attachment (attach-media)) +(displayln attachment) (define id (hash-ref attachment 'id)) (define data (bytes-append @@ -72,9 +73,9 @@ (displayln (read-json response)) (displayln "Uploaded post!")) -;run upload-attachment very 30 mins +;run upload-attachment very 30 mins infinitely (define (loop) - (sleep 1740) + (sleep 1740) (upload-attachment) (loop))