Files
URLNotesGrabberCore/URLNotesGrabberCORE/ResponseNotes.cs
T
jim bc9985a6f0 Add support for fetching and storing reply text
- Add database migration and update logic for replyText column in Notes
- Implement batch collection of missing reply text via Tumblr API
- Add new API integration to fetch reply text for replies
- Enhance DataAccess with methods to query/update replyText
- Update CLI: -replies now collects and stores reply text
- Improve logging (archive logs/), error handling, and output
- Remove TL.db from source control
2026-02-12 23:12:54 -06:00

120 lines
3.0 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace URLNotesGrabberCORE
{
internal class ResponseNotes
{
}
// Root myDeserializedClass = JsonConvert.DeserializeObject<Root>(myJsonResponse);
public class AvatarUrl
{
[JsonProperty("64")]
public string _64 { get; set; }
[JsonProperty("128")]
public string _128 { get; set; }
}
public class Links
{
public Next next { get; set; }
}
public class Meta
{
public int status { get; set; }
public string msg { get; set; }
}
public class Next
{
public string href { get; set; }
public string method { get; set; }
public QueryParams query_params { get; set; }
}
public class Note
{
public string type { get; set; }
public int timestamp { get; set; }
public string blog_name { get; set; }
public string blog_uuid { get; set; }
public string blog_url { get; set; }
public bool followed { get; set; }
public string avatar_shape { get; set; }
public AvatarUrl avatar_url { get; set; }
public string post_id { get; set; }
public string reblog_parent_blog_name { get; set; }
}
public class QueryParams
{
public string mode { get; set; }
public string id { get; set; }
public string before_timestamp { get; set; }
}
public class Response
{
public List<Note> notes { get; set; }
public int total_notes { get; set; }
public bool is_subscribed { get; set; }
public bool can_subscribe { get; set; }
public bool can_hide_or_delete_notes { get; set; }
public bool conversational_notifications_enabled { get; set; }
public Links _links { get; set; }
}
public class Root
{
public Meta meta { get; set; }
[JsonConverter(typeof(EmptyArrayOrObjectConverter<Response>))]
public Response response { get; set; }
public string statusCode { get; set; }
public int retryInSeconds { get; set; }
public string rawJson { get; set; }
}
// Classes for Posts API endpoint (for reply_text)
public class PostsResponse
{
public List<Post> posts { get; set; }
}
public class Post
{
public long id { get; set; }
public List<NoteDetail> notes { get; set; }
}
public class NoteDetail
{
public long timestamp { get; set; }
public string type { get; set; }
public string blog_name { get; set; }
public string reply_text { get; set; }
}
public class PostsRoot
{
public Meta meta { get; set; }
[JsonConverter(typeof(EmptyArrayOrObjectConverter<PostsResponse>))]
public PostsResponse response { get; set; }
public string statusCode { get; set; }
public int retryInSeconds { get; set; }
public string rawJson { get; set; }
}
}