Uwaa/Pleroma.Test/Program.cs
2024-12-11 02:50:32 +00:00

32 lines
894 B
C#

using System;
using System.Threading.Tasks;
namespace Uwaa.Pleroma.Test;
static class Program
{
static void Main(string[] args)
{
MainInline().Wait();
}
static async Task MainInline()
{
Pleroma client = new Pleroma("localhost", "Bearer abcdefghijklmnopqrstuvwxyz");
Account account = await client.GetAccount();
Status[] statuses = await client.GetTimeline();
Console.WriteLine($"Account: {account} ({account.ID})");
Console.WriteLine("Public statuses:");
foreach (Status status in statuses)
{
Console.Write('\t');
Console.Write(status.CreatedAt.ToShortDateString());
Console.Write(' ');
Console.Write(status.CreatedAt.ToLongTimeString());
Console.Write(' ');
Console.WriteLine(status);
}
Console.ReadKey();
}
}