using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AllBase;
namespace Work.CollectClass
{
public class LoadCloudData
{
///
/// 过滤标题词
///
public static List NoTitleWord = new List();
///
/// 过来品牌词
///
public static List NoBrand = new List();
///
/// 加载云词
///
public void Get()
{
string url = BaseClass.LoginApiUrl + "taobao/筛选词.txt";
string path = "temp/notitleword.tjm";
string html;
if (FileBase.Exists(path))
html = FileBase.ReadAllText(path, Encoding.Default);
else
{
html = GetHtml.Utf8(url);
FileBase.WriteAllText(path, html, Encoding.Default);
}
if (string.IsNullOrEmpty(html))
{
LogSave.Add("链接云数据库失败");
return;
}
string[] l = html.Split('\n');
for (int i = 0; i < l.Length; i++)
{
string s = l[i].Trim();
if (string.IsNullOrEmpty(s) || s.Length < 2)
continue;
string num = BaseRegex.GetMatchRegexString(ref s, @"([\d]+)");
if (!string.IsNullOrEmpty(num) && num.Length == s.Length)
continue;
NoTitleWord.Add(s);
}
url = BaseClass.LoginApiUrl + "taobao/品牌词.txt";
path = "temp/nobrand.tjm";
if (FileBase.Exists(path))
html = FileBase.ReadAllText(path, Encoding.Default);
else
{
html = GetHtml.Utf8(url);
FileBase.WriteAllText(path, html, Encoding.Default);
}
if (string.IsNullOrEmpty(html))
{
LogSave.Add("链接云数据库失败");
return;
}
l = html.Split('\n');
for (int i = 0; i < l.Length; i++)
{
string s = l[i].Trim();
if (string.IsNullOrEmpty(s) || s.Length < 2)
continue;
string num = BaseRegex.GetMatchRegexString(ref s, @"([\d]+)");
if (!string.IsNullOrEmpty(num) && num.Length == s.Length)
continue;
NoBrand.Add(s);
}
}
}
}