/// <summary>
        /// 读取Github的配置
        /// </summary>
        public static GithubWebConfig <GithubReceiver> ReadSettingForGithub()
        {
            ATLog.Info("读取Github的配置");
            GithubWebConfig <GithubReceiver> config = new GithubWebConfig <GithubReceiver>();

            string settingContent = File.ReadAllText(githubConfPath);
            Configure <GithubReceiver> githubConfigure = Newtonsoft.Json.JsonConvert.DeserializeObject <Configure <GithubReceiver> >(settingContent);

            config.Convert(githubConfigure);
            return(config);
        }
Exemple #2
0
        static SpiderMain()
        {
            ReadSettingAction += (types) =>
            {
                foreach (var item in types)
                {
                    switch (item)
                    {
                    case WebType.github:
                        githubConf = FunctionSetting.ReadSettingForGithub();
                        break;

                    case WebType.zhihu:
                        zhihuConf = FunctionSetting.ReadSettingForZhihu();
                        break;
                    }
                }
            };
        }