e.Trim().ToLower()).ToArray(); return string.Join(",",((ResultField[])Model.Headers).Where(e => !string.IsNullOrEmpty(e.Tag) && fields.Contains(e.Identifier.ToLower())).Select(e => e.Tag).Distinct().ToArray()); } string bool2dim() { return (Model.Ids.Split('\n').Length > 1 ? "$.*" : "$"); } string FetchIdsBatch() { string[] lines = ((string)Model.Ids).Trim().Split('\n').Select(e => e.Trim()).Where(e => !string.IsNullOrEmpty(e)).ToArray(); return string.Join(",",lines.Select(e => Utils.UrlEncode(e)).ToArray()); } string GetCommentId() { Regex regexCommentId = new Regex(@"\?comment_id=(\d+)"); Regex regexPostId = new Regex(@"/posts/(\d+)"); Regex regexReplyId = new Regex(@"\?reply_comment_id=(\d+)"); string commentId = ""; string postId = ""; string replyId = ""; string fullId = ""; if(regexCommentId.IsMatch(Model.Link)) { Match match = regexCommentId.Match(Model.Link); commentId = match.Groups[1].Value; } if(regexPostId.IsMatch(Model.Link)) { Match match = regexPostId.Match(Model.Link); postId = match.Groups[1].Value; } if(regexReplyId.IsMatch(Model.Link)) { Match match = regexReplyId.Match(Model.Link); replyId = match.Groups[1].Value; } if(!string.IsNullOrEmpty(replyId)) { fullId = commentId + "_" + replyId; } else { fullId = postId + "_" + commentId; } return fullId; } ]]>