Example #1
0
        public static void GatheringNewsFromAuthor_Bjh()
        {
            try
            {
                if (Global.IsEnableBjhAuthorGather != "1")
                {
                    return;
                }
                ////时段控制 0-8点不抓取
                //if (DateTime.Now.Hour < 8)
                //{
                //    return;
                //}
                var i = 0;
                while (true && ProxyDeal.IsProxyReady)
                {
                    i++;
                    Log.Info("从百家号作者主页抓取开始 i=" + i + " time=" + DateTime.Now);

                    var bll = new BaijiahaoGather();

                    bll.GatheringNewsFromAuthor();

                    Log.Info("从百家号作者主页抓取结束 i=" + i + " time=" + DateTime.Now);
                    Thread.Sleep(60 * 1000);
                }
                if (!ProxyDeal.IsProxyReady)
                {
                    Log.Info("代理未准备好" + DateTime.Now);
                    Thread.Sleep(60 * 1000);
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex.Message + ex.StackTrace);
            }
        }
 public void SetUp()
 {
     bll = new BaijiahaoGather();
 }