예제 #1
0
파일: RobotBase.cs 프로젝트: jefth/sinawler
        protected StatusQueue queueStatus;                 //微博队列引用

        //构造函数,需要传入相应的新浪微博API和主界面
        public RobotBase(SysArgFor robotType)
        {
            crawler = new SinaMBCrawler(robotType);
            api     = GlobalPool.GetAPI(robotType);
            switch (robotType)
            {
            case SysArgFor.USER_INFO:
                if (iMinSleep < GlobalPool.MinSleepMsForUserInfo)
                {
                    iMinSleep = GlobalPool.MinSleepMsForUserInfo;
                }
                break;

            case SysArgFor.USER_TAG:
                if (iMinSleep < GlobalPool.MinSleepMsForUserTag)
                {
                    iMinSleep = GlobalPool.MinSleepMsForUserTag;
                }
                break;

            case SysArgFor.STATUS:
                if (iMinSleep < GlobalPool.MinSleepMsForStatus)
                {
                    iMinSleep = GlobalPool.MinSleepMsForStatus;
                }
                break;

            case SysArgFor.COMMENT:
                if (iMinSleep < GlobalPool.MinSleepMsForComment)
                {
                    iMinSleep = GlobalPool.MinSleepMsForComment;
                }
                break;

            default:
                if (iMinSleep < GlobalPool.MinSleepMsForUserRelation)
                {
                    iMinSleep = GlobalPool.MinSleepMsForUserRelation;
                }
                break;
            }
            AdjustRealFreq();
        }
예제 #2
0
        protected StatusQueue queueStatus;                    //微博队列引用

        //构造函数,需要传入相应的新浪微博API和主界面
        public RobotBase(SysArgFor robotType)
        {
            crawler = new SinaMBCrawler(robotType);
            api = GlobalPool.GetAPI(robotType);
            switch (robotType)
            {
                case SysArgFor.USER_INFO:
                    if (iMinSleep < GlobalPool.MinSleepMsForUserInfo) iMinSleep = GlobalPool.MinSleepMsForUserInfo;
                    break;
                case SysArgFor.USER_TAG:
                    if (iMinSleep < GlobalPool.MinSleepMsForUserTag) iMinSleep = GlobalPool.MinSleepMsForUserTag;
                    break;
                case SysArgFor.STATUS:
                    if (iMinSleep < GlobalPool.MinSleepMsForStatus) iMinSleep = GlobalPool.MinSleepMsForStatus;
                    break;
                case SysArgFor.COMMENT:
                    if (iMinSleep < GlobalPool.MinSleepMsForComment) iMinSleep = GlobalPool.MinSleepMsForComment;
                    break;
                default:
                    if (iMinSleep < GlobalPool.MinSleepMsForUserRelation) iMinSleep = GlobalPool.MinSleepMsForUserRelation;
                    break;
            }
            AdjustRealFreq();
        }
예제 #3
0
 public SinaMBCrawler(SysArgFor crawlerType)
 {
     api = GlobalPool.GetAPI(crawlerType);
 }
예제 #4
0
 public SinaMBCrawler(SysArgFor crawlerType)
 {
     api = GlobalPool.GetAPI(crawlerType);
 }