GithubHelp home page GithubHelp logo

merlin04 / vgy.me Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 2.0 29 KB

A CLI for the image hosting website vgy.me

License: GNU General Public License v3.0

C# 100.00%
cli cli-app cli-application csharp dotnet api-client image-hosting upload-images uploader

vgy.me's Introduction

vgy.me

.NET Core

A CLI for the image hosting website vgy.me. To use this, you'll need a vgy.me userkey, which you can generate here.

Installation

Use the dotnet command line tool to install:

dotnet tool install -g vgy.me

Usage

Upload

Upload an image:

$ vgy.me upload file1.png
URL: https://vgy.me/u/demo
Image URL: https://i.vgy.me/demo.png
Delete: https://vgy.me/delete/democode

Upload an image with a title and description:

$ vgy.me upload file2.png -t "Title" -d "Description"

Upload multiple images to an album:

$ vgy.me upload file1.png file2.png file3.png
Album URL: https://vgy.me/album/demo
Images:
 - https://i.vgy.me/demo1.png
 - https://i.vgy.me/demo2.png
 - https://i.vgy.me/demo3.png

Delete

Delete an image using the delete URL:

$ vgy.me delete https://vgy.me/delete/democode

Delete an image using the viewer URL or image URL:

$ vgy.me delete https://vgy.me/u/demo

Delete all images uploaded since the app was installed (does not include images uploaded as part of an album):

$ vgy.me delete all

Configure

Set userkey:

vgy.me configure "insert-userkey-here"

Remove configuration file:

vgy.me configure reset

How it works

This tool is written in C#/.NET Core and uses the CliFx framework, which provides all of the behavior of command line apps you're used to like help screens and arguments. It also provides a way to implement dependency injection, which allows all of the commands to get access to an HttpClient and the configuration data, which is stored in ~/.vgy.me.json and is loaded when the app is run. Uploading images uses the vgy.me API, and deleting them uses ScrapySharp to access the delete page and click the delete button. The tool keeps track of the files you upload in the configuration file and can use that data to look up the delete URL for an image URL. Unfortunately, the vgy.me API does not provide a delete URL for albums so the tool can't keep track of those, you have to delete them from the web interface.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.