Browse Source

minor fixes

master
Brent Gordon 4 years ago
parent
commit
8ea70047e0
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      bot.rkt

+ 4
- 3
bot.rkt View File

@@ -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))



Loading…
Cancel
Save