Added ImgBB Test & Github Test applications with using environment variables

This commit is contained in:
iminet
2026-09-27 13:29:03 +02:00
parent e2d97d5710
commit 7600ed8240
5 changed files with 57 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
{
"dotnet.defaultSolution": "GithubTest.sln"
}
+15
View File
@@ -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="Octokit" Version="14.0.0" />
</ItemGroup>
</Project>
+20
View File
@@ -0,0 +1,20 @@
using System.Collections;
using Octokit;
namespace Iminetsoft.Dev.GithubTest
{
public static class Program
{
public static async Task Main(string[] Args)
{
var args = Iminetcore.ConsoleParser.ArgParser.ParseDynamic(Args);
var github = new GitHubClient(new ProductHeaderValue("GithubTest"));
github.Credentials = new Credentials(Environment.GetEnvironmentVariable("GITHUB_TOKEN"));
var repos = await github.Repository.GetAllForCurrent();
repos.ToList().ForEach(r => Console.WriteLine($"{r.Name}"));
}
}
}
+6
View File
@@ -1,3 +1,5 @@
using System.Collections;
namespace Iminetsoft.Dev.ImgBBTest
{
public static class Program
@@ -8,6 +10,10 @@ namespace Iminetsoft.Dev.ImgBBTest
Console.WriteLine("IMGBB Test Application");
Environment.GetEnvironmentVariables().Cast<DictionaryEntry>().OrderBy(x => x.Key).ToList().ForEach(x => Console.WriteLine($"\t{x.Key} :: {x.Value}"));
return;
var imgbb_token = Environment.GetEnvironmentVariable("IMGBB_TOKEN") ?? args.token ?? args.t;
var imgbb = new ImgBBApi(imgbb_token);
var uploaded = new List<string>();