Created
July 29, 2015 15:09
-
-
Save Shadey/5a4177e7217ebf3847b9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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