private static void SaveTopic(M01Topic topic) { ThriftTool.AddColumn(topic.Pid, "M01Topic", "Forum", topic.Forum); ThriftTool.AddColumn(topic.Pid, "M01Topic", "Pdate", topic.Pdate); ThriftTool.AddColumn(topic.Pid, "M01Topic", "Pid", topic.Pid); ThriftTool.AddColumn(topic.Pid, "M01Topic", "Uid", topic.Uid); ThriftTool.AddColumn(topic.Pid, "M01Topic", "Content", topic.Content); ThriftTool.AddColumn(topic.Pid, "M01Topic", "Plevel", topic.Plevel); ThriftTool.AddColumn(topic.Pid, "M01Topic", "Aid", topic.Aid); ThriftTool.AddColumn(topic.Pid, "M01Topic", "Aowner", topic.Aowner); ThriftTool.AddColumn(topic.Pid, "M01Topic", "Title", topic.Title); }
private static void ProcessPost(string post, ref string levelOneUid, ref string levelOnePid, string forum, string title) { var uid = WebTool.GetContent("userinfo.php?id=", "&", post); var uName = WebTool.StripTagsCharArray(WebTool.GetContent("<div class=\"fn\">", "</div>", post)); var content = WebTool.GetContent("<div class=\"single-post-content\">", "<div class=\"single-post-content-sig\">", post); var pid = WebTool.GetContent("<div id=\"ct", "\"", post); var tmpar = WebTool.GetContent("<div class=\"date\">", "</div>", post).Split('#'); var pdate = tmpar[0].Trim(); var plevel = tmpar[1].Trim(); var aid = string.Empty; var aowner = string.Empty; var blockquite = WebTool.GetContent("<blockquote>", "</blockquote>", post); var replyTo = WebTool.GetContent("<b>", " wrote:</b>", blockquite); if (!TmpUser.ContainsKey(uName)) { TmpUser.Add(uName, uid); } if (plevel == "1") { levelOnePid = pid; levelOneUid = uid; } else { aid = levelOnePid; aowner = levelOneUid; //add counter ThriftTool.CounterAdd(uid, "M01UserRelaction", string.IsNullOrEmpty(replyTo) ? levelOneUid : TmpUser[replyTo], 1); } var topic = new M01Topic { Forum = forum, Pid = pid, Uid = uid, Content = content, Pdate = pdate, Plevel = plevel, Aid = aid, Aowner = aowner, Title = title }; SaveTopic(topic); }
static void ProcessPost(string post, ref string levelOneUid, ref string levelOnePid, string forum, string title) { var uid = WebTool.GetContent("userinfo.php?id=", "&", post); var uName = WebTool.StripTagsCharArray(WebTool.GetContent("<div class=\"fn\">", "</div>", post)); var content = WebTool.GetContent("<div class=\"single-post-content\">", "<div class=\"single-post-content-sig\">", post); var pid = WebTool.GetContent("<div id=\"ct", "\"", post); var tmpar = WebTool.GetContent("<div class=\"date\">", "</div>", post).Split('#'); var pdate = tmpar[0].Trim(); var plevel = tmpar[1].Trim(); var aid = string.Empty; var aowner = string.Empty; var blockquite = WebTool.GetContent("<blockquote>", "</blockquote>", post); var replyTo = WebTool.GetContent("<b>", " wrote:</b>", blockquite); Console.WriteLine(TmpUser==null); if(!TmpUser.ContainsKey(uName)) TmpUser.Add(uName,uid); Console.WriteLine("pid=" + pid + " uid=" + uid + " name=" + uName); //if (!string.IsNullOrEmpty(replyTo)) Console.WriteLine("\tblockquote=" + replyTo); if (plevel == "1") { levelOnePid = pid; levelOneUid = uid; } else { aid = levelOnePid; aowner = levelOneUid; //add counter if(string.IsNullOrEmpty(replyTo)) { //ThriftTool.CounterAdd(uid, "M01UserRelaction", levelOneUid, 1); } else { Console.WriteLine("\tblockquote=" + TmpUser[replyTo]); } // } var topic = new M01Topic { Forum = forum, Pid = pid, Uid = uid, Content = content, Pdate = pdate, Plevel = plevel, Aid = aid, Aowner = aowner, Title = title }; //if (blockquite != null) //SaveTopic(topic); }