Skip to content
This repository has been archived by the owner on Feb 5, 2021. It is now read-only.

Proximyst/owo.clj

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

owo.clj

Clojure library to upload to OwO.Whats-Th.is?

Usage

To shorten a link: (This does not encode it for HTTP compatibility)

(owo.shorten/shorten-url
    token
    (java.net.URLEncoder/encode "https://owo.whats-th.is" "UTF-8")
    ; Past this point, everything is optional
    :user-agent "WhatsThisClientButCooler"
    :api-url "localhost"
    :base "" ; No base, so you'll only get the ID
    )

To upload a random byte array:

(let [data (byte-array 32)
      filename "test.bin" ; this is defaulted to a.bin
      content-type "application/octet-stream" ; this is defaulted
      ]
      (.nextBytes (ThreadLocalRandom/current) data)
      (owo/upload-data
          token
          (create-multipart {
              :filename filename ; Not necessary (defaults)
              :content-type content-type ; Not necessary (defaults)
              :data data
          })
          )
      )

To change any of the variables:

(def owo.variables/*api-url* "localhost")

Releases

No releases published

Packages

No packages published