mirror of
https://github.com/iminet/dev.git
synced 2026-10-15 01:24:54 +02:00
Added ImgBB Test app
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
namespace Iminetsoft.Dev.ImgBBTest
|
||||
{
|
||||
public static class Program
|
||||
{
|
||||
public static async Task Main(string[] Args)
|
||||
{
|
||||
var args = Iminetcore.ConsoleParser.ArgParser.ParseDynamic(Args);
|
||||
|
||||
Console.WriteLine("IMGBB Test Application");
|
||||
|
||||
var imgbb_token = Environment.GetEnvironmentVariable("IMGBB_TOKEN") ?? args.token ?? args.t;
|
||||
var imgbb = new ImgBBApi(imgbb_token);
|
||||
var uploaded = new List<string>();
|
||||
|
||||
var files = ((string)args.files ?? (string)args.f).Split(",").ToList();
|
||||
|
||||
if (files.Count()>0)
|
||||
{
|
||||
uploaded = await imgbb.UploadImgbbAsync(files);
|
||||
uploaded.ForEach(f => Console.WriteLine(f));
|
||||
}
|
||||
else Console.WriteLine("No files added for uploading");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user