From 8fbb0717620947241b4e68a5730108f9e4f7e6a0 Mon Sep 17 00:00:00 2001 From: 8402134 <8402134@qq.com> Date: Fri, 23 Sep 2022 14:48:20 +0800 Subject: [PATCH] 1 --- 应用/Weixin.CircleTools/Class1.cs | 7 +++ 应用/Weixin.CircleTools/MainForm.cs | 1 - .../Weixin.CircleTools/SendTaskForm.Designer.cs | 38 ++++++++-------- 应用/Weixin.CircleTools/SendTaskForm.cs | 10 +++-- 类库/Api.Framework/Cps/AlimamaApi.cs | 45 ++++++++++++++++++- 类库/Api.Framework/Tools/TBHelper.cs | 10 +++-- 6 files changed, 81 insertions(+), 30 deletions(-) diff --git a/应用/Weixin.CircleTools/Class1.cs b/应用/Weixin.CircleTools/Class1.cs index e84666b..d218109 100644 --- a/应用/Weixin.CircleTools/Class1.cs +++ b/应用/Weixin.CircleTools/Class1.cs @@ -48,6 +48,13 @@ namespace CircleFriendsTools session.AddColumn("fl_plugin_circletools_taskinfos", "robotnames", "text"); session.ExcuteSQL("update fl_plugin_circletools_taskinfos set robotnames = '" + string.Join(",", session.FindRobots().Select(f => f.name)) + "'"); } + + try + { + session.UpdateColumnType("fl_plugin_circletools_taskinfos", "robotnames", "text"); + } + catch (Exception) + { } } if (session.TableExist()) { diff --git a/应用/Weixin.CircleTools/MainForm.cs b/应用/Weixin.CircleTools/MainForm.cs index d7c6b7c..3d36879 100644 --- a/应用/Weixin.CircleTools/MainForm.cs +++ b/应用/Weixin.CircleTools/MainForm.cs @@ -4,7 +4,6 @@ using Api.Framework.Enums; using Api.Framework.Model; using Api.Framework.SDK; using Api.Framework.Tools; -using Chat.Framework.Utils; using Chat.Framework.WXSdk; using Chat.Framework.WXSdk.Implement; using System; diff --git a/应用/Weixin.CircleTools/SendTaskForm.Designer.cs b/应用/Weixin.CircleTools/SendTaskForm.Designer.cs index 3d9d378..47d3314 100644 --- a/应用/Weixin.CircleTools/SendTaskForm.Designer.cs +++ b/应用/Weixin.CircleTools/SendTaskForm.Designer.cs @@ -29,6 +29,8 @@ private void InitializeComponent() { this.groupControl1 = new DevExpress.XtraEditors.GroupControl(); + this.textBox2 = new System.Windows.Forms.TextBox(); + this.textBox1 = new System.Windows.Forms.TextBox(); this.checkedComboBoxEdit_ChatType = new DevExpress.XtraEditors.CheckedComboBoxEdit(); this.label4 = new System.Windows.Forms.Label(); this.labelControl2 = new DevExpress.XtraEditors.LabelControl(); @@ -49,8 +51,6 @@ this.label2 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.checkedComboBoxEdit1 = new DevExpress.XtraEditors.CheckedComboBoxEdit(); - this.textBox1 = new System.Windows.Forms.TextBox(); - this.textBox2 = new System.Windows.Forms.TextBox(); ((System.ComponentModel.ISupportInitialize)(this.groupControl1)).BeginInit(); this.groupControl1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.checkedComboBoxEdit_ChatType.Properties)).BeginInit(); @@ -89,6 +89,22 @@ this.groupControl1.TabIndex = 0; this.groupControl1.Text = "任务信息"; // + // textBox2 + // + this.textBox2.Location = new System.Drawing.Point(45, 402); + this.textBox2.Multiline = true; + this.textBox2.Name = "textBox2"; + this.textBox2.Size = new System.Drawing.Size(471, 113); + this.textBox2.TabIndex = 40; + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(45, 228); + this.textBox1.Multiline = true; + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(471, 148); + this.textBox1.TabIndex = 39; + // // checkedComboBoxEdit_ChatType // this.checkedComboBoxEdit_ChatType.EditValue = ""; @@ -271,22 +287,6 @@ this.checkedComboBoxEdit1.Size = new System.Drawing.Size(311, 20); this.checkedComboBoxEdit1.TabIndex = 0; // - // textBox1 - // - this.textBox1.Location = new System.Drawing.Point(45, 228); - this.textBox1.Multiline = true; - this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(471, 148); - this.textBox1.TabIndex = 39; - // - // textBox2 - // - this.textBox2.Location = new System.Drawing.Point(45, 402); - this.textBox2.Multiline = true; - this.textBox2.Name = "textBox2"; - this.textBox2.Size = new System.Drawing.Size(471, 113); - this.textBox2.TabIndex = 40; - // // SendTaskForm // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F); @@ -328,10 +328,10 @@ private DevExpress.XtraEditors.LabelControl labelControl2; private DevExpress.XtraEditors.LabelControl labelControl3; private DevExpress.XtraEditors.LabelControl labelControl1; - private DevExpress.XtraEditors.CheckedComboBoxEdit checkedComboBoxEdit_ChatType; private System.Windows.Forms.Label label4; private System.Windows.Forms.Label label11; private System.Windows.Forms.TextBox textBox2; private System.Windows.Forms.TextBox textBox1; + private DevExpress.XtraEditors.CheckedComboBoxEdit checkedComboBoxEdit_ChatType; } } \ No newline at end of file diff --git a/应用/Weixin.CircleTools/SendTaskForm.cs b/应用/Weixin.CircleTools/SendTaskForm.cs index 2b5719b..ef4cf51 100644 --- a/应用/Weixin.CircleTools/SendTaskForm.cs +++ b/应用/Weixin.CircleTools/SendTaskForm.cs @@ -56,7 +56,7 @@ namespace Weixin.CircleTools { try { - EventClient.OnEvent("", $"数量:{(data == null ? 0 : data.Count)}"); + //EventClient.OnEvent("", $"数量:{(data == null ? 0 : data.Count)}"); checkedComboBoxEdit_ChatType.Properties.Items.Clear(); var clients = Chat.Framework.ChatClient.WXClient; @@ -64,7 +64,7 @@ namespace Weixin.CircleTools { if (item.WeixinType == Chat.Framework.WXSdk.Implement.WeixinType.Grpc微信 || item.WeixinType == Chat.Framework.WXSdk.Implement.WeixinType.Hook微信) { - if (data != null && data.FirstOrDefault(f => f == item.WeixinHao) != null) + if (data != null && data.FirstOrDefault(f => f.Trim() == item.WeixinHao.Trim()) != null) checkedComboBoxEdit_ChatType.Properties.Items.Add(item.WeixinHao, item.User.Nick, CheckState.Checked, true); else checkedComboBoxEdit_ChatType.Properties.Items.Add(item.WeixinHao, item.User.Nick, CheckState.Unchecked, true); @@ -123,11 +123,13 @@ namespace Weixin.CircleTools taskinfo.task_sendtext = textBox1.Text; taskinfo.task_comment = textBox2.Text; //taskinfo.robotnames = checkedComboBoxEdit_ChatType.EditValue.ToString(); - var robotnames = checkedComboBoxEdit_ChatType.Properties.Items.Where(f => f.CheckState == CheckState.Checked).Select(f => f.Value.ToString()).ToList(); + //var robotnames = checkedComboBoxEdit_ChatType.Properties.Items.Where(f => f.CheckState == CheckState.Checked).Select(f => f.Value.ToString()).ToList(); + + var robotnames = checkedComboBoxEdit_ChatType.Properties.GetCheckedItems().ToString().Replace(", ", ",").Replace(" ,", ",").Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries).Select(f => f.Trim()).ToList(); taskinfo.robotnames = string.Join(",", robotnames); - EventClient.OnEvent("", $"保存数据:{taskinfo.robotnames}"); + //EventClient.OnEvent("", $"保存数据:{taskinfo.robotnames}"); var sql = string.Empty; if (taskinfo.id == 0) diff --git a/类库/Api.Framework/Cps/AlimamaApi.cs b/类库/Api.Framework/Cps/AlimamaApi.cs index 48be361..0d9d094 100644 --- a/类库/Api.Framework/Cps/AlimamaApi.cs +++ b/类库/Api.Framework/Cps/AlimamaApi.cs @@ -2117,7 +2117,7 @@ html => {html}"); try { //Console.WriteLine(url); - Thread.Sleep(300 + random.Next(700, 1000)); + Thread.Sleep(300 + random.Next(700, 3000)); HttpHelper _http = new HttpHelper(); HttpItem item = new HttpItem() @@ -2154,11 +2154,47 @@ html => {html}"); /// private static Random random = new Random(); + /// + /// 淘宝活动页参数 + /// + private List ActivityList = new List() { "official", "union", "local", "tbtm", "atb", "bpk" }; + /// /// 更新阿里妈妈Cookies /// internal void UpdateCookies() { + GetAlimamaHtml("https://pub.alimama.com/portal/home/index.htm"); + GetAlimamaHtml("https://pub.alimama.com/promo/search/index.htm"); + + for (int i = 0; i < 2; i++) + { + var index = random.Next(0, ActivityList.Count); + GetAlimamaHtml($"https://pub.alimama.com/portal/promo/activity.htm?tab={ActivityList[index]}"); + } + + GetAlimamaHtml("https://pub.alimama.com/portal/account/settle/income/index.htm"); + GetAlimamaHtml("https://media.alimama.com/account/drawback/list.htm"); + GetAlimamaHtml("https://pub.alimama.com/fourth/tool/api/index.htm"); + GetAlimamaHtml("https://pub.alimama.com/portal/v2/tool/links/page/home/index.htm"); + GetAlimamaHtml("https://dmp.taobao.com/"); + GetAlimamaHtml("https://pub.alimama.com/"); + GetAlimamaHtml("https://subway.simba.taobao.com/indexnew.jsp"); + GetAlimamaHtml("https://pub.alimama.com/openapi/param2/1/gateway.unionpub/thor.campaign.report.json", $"t={HttpExtend.GetTimeStamp(DateTime.Now, true)}&campaignName=&gap=7&pageSize=20&page=1"); + GetAlimamaHtml("https://pub.alimama.com/openapi/param2/1/gateway.unionpub/thor.ad.unit.report.json", $"t={HttpExtend.GetTimeStamp(DateTime.Now, true)}&itemId=&pid=&gap=1&pageSize=20&page=1&campaignId="); + GetAlimamaHtml("https://pub.alimama.com/openapi/json2/1/gateway.unionpub/xt.entry.json", $"t={HttpExtend.GetTimeStamp(DateTime.Now, true)}&_tb_token_=eb53bb61783d6&_data_=%7B%22floorId%22%3A36306%2C%22variableMap%22%3A%7B%22status%22%3A%22check%22%2C%22orderType%22%3A%22%22%7D%2C%22pageNum%22%3A%221%22%2C%22pageSize%22%3A%2220%22%7D"); + GetAlimamaHtml($"https://pub.alimama.com/openapi/param2/1/gateway.unionpub/asset.entry.json?t={HttpExtend.GetTimeStamp(DateTime.Now, true)}&bizType=asset.asset-accountQuery&bizParam="); + GetAlimamaHtml($"https://pub.alimama.com/common/site/getAuthorities.json?t={HttpExtend.GetTimeStamp(DateTime.Now, true)}&siteId=111111"); + GetAlimamaHtml($"https://mo.m.taobao.com/union/mm/pub-common/frontversion"); + GetAlimamaHtml($"https://aff-open.taobao.com/apply.htm"); + + + + + + + + GetAlimamaHtml("http://www.alimama.com/index.htm"); GetAlimamaHtml("https://ssp.tanx.com/api/userinfo?callback=userInfoCallback"); GetAlimamaHtml("http://ssp.tanx.com/api/userinfo?callback=userInfoCallback"); @@ -2175,7 +2211,7 @@ html => {html}"); var page = random.Next(1, 5); var size = page * 10; - GetAlimamaHtml($"https://media.alimama.com/violationu2/violation2_page.json?r=mx_794&toPage={page}&pageSize=40"); + GetAlimamaHtml($"https://media.alimama.com/violationu2/violation2_page.json?r=mx_387&toPage={page}&pageSize=40"); if (page % 2 != 0) { @@ -2232,6 +2268,11 @@ html => {html}"); GetAlimamaHtml($"https://pub.alimama.com/openapi/param2/1/gateway.unionpub/report.getTbkOrderDetails.json?t={HttpExtend.GetTimeStamp()}000&_tb_token_=33183d55eb1e6&jumpType=0&positionIndex=&pageNo=1&startTime={date1}&endTime={date2}&queryType={type}&tkStatus=&memberType=&pageSize=40"); } + for (int i = 0; i < 5; i++) + { + GetAlimamaHtml($"https://pub.alimama.com/openapi/param2/1/gateway.unionpub/mkt.campaign.signUp.list.json?t={HttpExtend.GetTimeStamp(DateTime.Now, true)}&pageNo=1&pageSize=20&keyword=&showStatus={(i + 1)}&productType=19&phaseType=3&searchType=1"); + } + CheckLoginAlimama(); GetAlimamaHtml("https://pub.alimama.com/common/getUnionPubContextInfo.json"); diff --git a/类库/Api.Framework/Tools/TBHelper.cs b/类库/Api.Framework/Tools/TBHelper.cs index 6bbe2a6..f518f29 100644 --- a/类库/Api.Framework/Tools/TBHelper.cs +++ b/类库/Api.Framework/Tools/TBHelper.cs @@ -1104,11 +1104,13 @@ namespace Api.Framework.Tools // //} //} - mess = Util.RemoveEmoji(mess); - mess = Regex.Replace(mess, @"[]", "");//这里有两个看不见的字符,两个字符不一样,都要删除了(这个只针对Ipad协议) - - item_id = GetItemInfoByPass(mess, tklTmps, api, pids); + if (tklTmps.Count > 0) + { + mess = Util.RemoveEmoji(mess); + mess = Regex.Replace(mess, @"[]", "");//这里有两个看不见的字符,两个字符不一样,都要删除了(这个只针对Ipad协议) + item_id = GetItemInfoByPass(mess, tklTmps, api, pids); + } } return item_id; }