using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; namespace wakka { public class FeelsPost { [JsonPropertyName("user")] public string? User { get; set; } [JsonPropertyName("path")] public string? Path { get; set; } [JsonPropertyName("m_time")] public long M_Time { get; set; } public string TimeString { get; set; } = string.Empty; public string Body { get; set; } = string.Empty; public int WordCount { get; set; } = 0; } internal class Feels { private static SshConnection Ssh { get; set; } = new SshConnection(); public List? AllFeels() { return JsonSerializer.Deserialize>(Ssh.RunCommand("~nebula/bin/dumpfeels")); } public List? FeelsAfter(long TimeStamp) { return JsonSerializer.Deserialize>(Ssh.RunCommand($"~nebula/bin/dumpfeels --after {TimeStamp}")); } public List? FeelsFromUser(string User, List Feels) { return Feels.FindAll(i => i.User == User); } public string GetFeelsBody(FeelsPost Post) { return Ssh.RunCommand($"cat {Post.Path}"); } } }