all repos — dotfiles @ 9b35a98fa8bd56a4d8301bf4e5e0e12d8f7dd557

my *nix dotfiles

bin/oxo.nim (view raw)

 1#!/usr/bin/env nimcr
 2
 3import httpclient
 4import os
 5import strformat
 6
 7var client = newHttpClient()
 8var data = newMultipartData()
 9
10try:
11  var file = paramStr(1)
12  try:
13    data.addFiles({"file": fmt"{file}"})
14  except IOError:
15    echo ";("
16  let url = "http://0x0.st"
17  echo client.postContent(url, multipart=data)
18except IndexError:
19  echo "no file specified :v"
20  quit(1)