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,15 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<TargetFramework>net10.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Iminetcore" Version="26.8.2419.568" />
|
||||||
|
<PackageReference Include="Iminetsoft.ImgBBApi" Version="1.0.6" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
@@ -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