public static async Task<PostObject> CreateReply(LastReply reply, string board) { PostObject tempThreadReply = new PostObject(); tempThreadReply.Name = reply.name; // Poster Name tempThreadReply.Time = Parse.Time(reply.now); // Time (EDT/EST) tempThreadReply.Comment = (reply.com == null) ? "(Blank Post)" : Parse.Comment(reply.com); // Comment tempThreadReply.Thumbnail = await ChanRequest.GetPostThumb(board, reply.tim.ToString(), reply.ext); // Thumbnail tempThreadReply.ImageFileName = reply.tim.ToString(); // File identifier (number) tempThreadReply.ImageFileExt = reply.ext; // File extension tempThreadReply.Board = board; // Board return tempThreadReply; }
public static async Task<PostObject> CreateThread(Thread thread, string board) { PostObject tempThreadPost = new PostObject(); tempThreadPost.Number = thread.no.ToString(); // Number tempThreadPost.Subject = (thread.sub == null) ? "(No Subject)" : thread.sub; // Subject tempThreadPost.Name = thread.name; // Poster name tempThreadPost.Time = Parse.Time(thread.now); // Time (EDT/EST) tempThreadPost.Comment = (thread.com == null) ? "(No Comment)" : Parse.Comment(thread.com); // Post comment tempThreadPost.Thumbnail = await ChanRequest.GetPostThumb(board, thread.tim.ToString(), thread.ext); // Thumbnail tempThreadPost.ImageFileName = thread.tim.ToString(); // File identifier (number) tempThreadPost.ImageFileExt = thread.ext; // File extension tempThreadPost.Board = board; // Board tempThreadPost.Stats = thread.replies + " total posts, " + thread.images + " images."; // Stats return tempThreadPost; }
public static async Task<PostObject> CreatePost(Post post, string board) { PostObject tempPost = new PostObject(); tempPost.Subject = (post.sub == null) ? "(No Subject)" : post.sub; // Subject tempPost.Name = post.name; // Poster name tempPost.Time = Parse.Time(post.now); // Time (EDT/EST) tempPost.Comment = (post.com == null) ? "(No Comment)" : Parse.Comment(post.com); // Post comment if(post.tim != null) { tempPost.Thumbnail = await ChanRequest.GetPostThumb(board, post.tim.ToString(), post.ext); // Thumbnail tempPost.ImageFileName = post.tim.ToString(); // File identifier (number) tempPost.ImageFileExt = post.ext; // File extension } tempPost.Board = board; // Board return tempPost; }