Skip to content

Instantly share code, notes, and snippets.

@Shadey
Created July 29, 2015 15:09
Show Gist options
  • Save Shadey/5a4177e7217ebf3847b9 to your computer and use it in GitHub Desktop.
Save Shadey/5a4177e7217ebf3847b9 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
import tkinter as tk
from tkinter import filedialog
import os
try:
import requests
except ImportError:
print("No requests module.Try sudo pip install requests")
os.exit(1)
root = tk.Tk()
root.withdraw()
f = filedialog.askopenfile()
r = requests.post("https://jii.moe/api/v1/upload",files={'file':open(f.name,'rb')})
os.system("notify-send " + r.json()["url"])
os.system("echo '{}' | xclip -selection clipboard".format(r.json()['url']))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment