Example #1
0
        /// <summary>
        /// 执行抓取
        /// </summary>
        List <OpenResult> IPicker.Run()
        {
            try
            {
                _168Picker        picker   = new _168Picker(URL, LotteryEnum.JSK3);
                List <OpenResult> dataList = picker.Pick();
                return((from o in dataList
                        select new OpenResult
                {
                    create_time = DateTime.Now,
                    open_time = o.open_time,
                    lottery_code = o.lottery_code,
                    issue_number = Convert.ToInt64("20" + o.issue_number),
                    open_data = o.open_data,
                    data_source = DataSourceEnum._168
                }).OrderBy(o => o.issue_number).ToList());
            }
            catch (Exception ex)
            {
                AppLog appLog = new AppLog
                {
                    create_time  = DateTime.Now,
                    log_type     = LogTypeEnum.ERROR,
                    lottery_code = LotteryEnum.JSK3,
                    data_source  = DataSourceEnum._168,
                    log_message  = ex.ToString()
                };
                AlphaLogManager.Error(appLog);

                return(new List <OpenResult>());
            }
        }
Example #2
0
        /// <summary>
        /// 执行抓取
        /// </summary>
        List <OpenResult> IPicker.Run()
        {
            try
            {
                _168Picker picker = new _168Picker(URL, LotteryEnum.BJK3);
                return(picker.Pick());
            }
            catch (Exception ex)
            {
                AppLog appLog = new AppLog
                {
                    create_time  = DateTime.Now,
                    log_type     = LogTypeEnum.ERROR,
                    lottery_code = LotteryEnum.BJK3,
                    data_source  = DataSourceEnum._168,
                    log_message  = ex.ToString()
                };
                AlphaLogManager.Error(appLog);

                return(new List <OpenResult>());
            }
        }