Beispiel #1
0
        public void SingleCapture(string categoryName)
        {
            var cursor = GetCurrentCursor(categoryName);

            UpdateCategoryCursor(categoryName, cursor);
            NLogHelper.WriteInfo(string.Format("{0} cursor is {1}", categoryName, cursor));
        }
Beispiel #2
0
 public void SaveContentList(string category, List <TouTiaoContent> contentList)
 {
     if (contentList != null && contentList.Count > 0)
     {
         var no_repeat = 0;
         foreach (var item_content in contentList)
         {
             var touTiaoModel = item_content.To <NewsContent>();
             touTiaoModel.CategoryId    = GetCategoryId(category);
             touTiaoModel.SubCategoryId = GetSubCategoryId(category);
             var exist = dbContextService.Exists <NewsContent>(x => x.NewsId == item_content.NewsId);
             if (!exist)
             {
                 no_repeat++;
                 touTiaoModel = ImageSave(item_content, touTiaoModel);
                 dbContextService.Add <NewsContent>(touTiaoModel);
             }
         }
         NLogHelper.WriteInfo(string.Format("{0} content count is {1}. Not repeat content count is {2} ", category, contentList.Count, no_repeat));
     }
 }