From da5dc421dab6948a85a7bd1572b297d2db8242a3 Mon Sep 17 00:00:00 2001 From: E2Kay Date: Thu, 12 Jul 2018 22:47:36 +0300 Subject: [PATCH] init --- .gitignore | 182 ++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 0 client.py | 13 ++++ screenshot.sh | 7 ++ sharex.sxcu | 6 ++ 5 files changed, 208 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 client.py create mode 100755 screenshot.sh create mode 100644 sharex.sxcu diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2936e91 --- /dev/null +++ b/.gitignore @@ -0,0 +1,182 @@ + +# Created by https://www.gitignore.io/api/python,pycharm + +### PyCharm ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +### PyCharm Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml +# .idea/misc.xml +# *.ipr + +# Sonarlint plugin +.idea/sonarlint + +### Python ### +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ + +### Python Patch ### +.venv/ + + +# End of https://www.gitignore.io/api/python,pycharm + +img/ + diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/client.py b/client.py new file mode 100644 index 0000000..a64b794 --- /dev/null +++ b/client.py @@ -0,0 +1,13 @@ +import requests +import sys +import pyperclip + +URL = 'http://localhost:5000/uploadcli' + +file = {'file': open(sys.argv[1], 'rb')} +r = requests.post(URL, files=file) + +if r.status_code == 200: + pyperclip.copy(r.text) +else: + print(r.text) diff --git a/screenshot.sh b/screenshot.sh new file mode 100755 index 0000000..66613c8 --- /dev/null +++ b/screenshot.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +DATE=`date '+%Y-%m-%d-%H-%M-%S'` +FULL_PATH="/home/USER/Pictures/Screenshots/"$DATE".jpg" + +scrot -s "$FULL_PATH" +python client.py $FULL_PATH diff --git a/sharex.sxcu b/sharex.sxcu new file mode 100644 index 0000000..441a8f3 --- /dev/null +++ b/sharex.sxcu @@ -0,0 +1,6 @@ +{ + "Name": "imageshare", + "DestinationType": "ImageUploader", + "RequestURL": "localhost:5000/uploadcli", + "FileFormName": "file" +} \ No newline at end of file