Пример #1
0
        /// <summary>
        /// 判断单条微博是否需要继续跟踪
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        public static bool ShouldKeepFollow(Item item)
        {
            if (item.CountHistory == null || item.CountHistory.Length == 0)
            {
                return(true);
            }
            ItemCountData LastCount = null;

            if (item.CountHistory.Length > 1)
            {
                LastCount = item.CountHistory[item.CountHistory.Length - 2];
            }
            return(item.CountHistory[item.CountHistory.Length - 1].ShouldKeepFollow(LastCount, 0, DefaultSettings.EndReplyCount, DefaultSettings.EndForwardCount));
        }
Пример #2
0
        /// <summary>
        /// 设置单条微博的转发和跟踪规则,默认为每15分钟刷一次转发和评论
        /// </summary>
        /// <param name="item">微博</param>
        /// <param name="source">微博来源</param>
        public static void SetItemTrackingRule(Item item, Enums.AuthorSource source)
        {
            item.Tracking = null;

            item.Tracking_Forward = new ItemTracking();
            item.Tracking_Forward.FollowNextTime = Utilities.Epoch;
            if (ItemCountData.ShouldFollow(item.CurrentCount, -1, DefaultSettings.MinReply, DefaultSettings.MinForward))
            {
                item.Tracking_Forward.FollowStatus = Enums.CrawlStatus.Normal;
            }
            else
            {
                item.Tracking_Forward.FollowStatus = Enums.CrawlStatus.Stop;
            }
            item.Tracking_Forward.FollowPriority = 0;
        }