zx 6 years ago
parent
commit
b576e53685

+ 38 - 4
FCS.Crawler/Content/Jobs/BasketJobs/Basketball/B_GroupingJob.cs

@@ -10,20 +10,22 @@ using FCS.Common;
 using FCS.Models.Entity;
 using HtmlAgilityPack;
 using System.Threading;
+using Newtonsoft.Json;
 
 namespace FCS.Crawler.Basketball
 {
     public class B_GroupingJob : CommonJob
     {
-        private string eventId = "", url = "";
-
+        private string eventId = "";
 
+   
         public void Click()
         {
-            GetNBA();
+            Click_NBA();
         }
 
-        public void GetNBA()
+        #region NBA
+        public void Click_NBA()
         {
             var result = new List<B_Grouping>();
             var url = "http://lanqiu.zgzcw.com/1/{0}/saiAll.do".FormatMe(
@@ -149,5 +151,37 @@ namespace FCS.Crawler.Basketball
                     };
             }
         }
+        #endregion
+
+        #region CBA
+        public void Click_CBA() {
+            var result = new List<B_Grouping>();
+            eventId = new B_EventsJob().GetEventList().Where(p => p.Name == ConfigurationManager.AppSettings["CBAEventName"]).ToList()[0].Id;
+            
+        }
+
+        /// <summary>
+        /// 得到NBA的期数
+        /// </summary>
+        /// <param name="doc"></param>
+        /// <returns></returns>
+        private IEnumerable<B_Grouping> GetCBASeason()
+        {
+            var oldSeason = (from a in services.Query<B_Grouping>(" AND EventId='{0}'".FormatMe(eventId))
+                             group a by a.Season into g
+                             select g.Key).ToList();
+            var url = "http://nba.nowscore.com/jsData/LeagueSeason/sea5.js";
+            var html = CommonHelper.GetHtmlString(new Models.DTO.HtmlParameterDTO { Url = url });
+            var data = JsonConvert.DeserializeObject<string[][]>(html);
+            foreach (var item in data)
+            {
+                yield return new B_Grouping
+                {
+                    Season = item[0].ToString(),
+                    Remark = item[1].ToString(),
+                };
+            }
+        }
+        #endregion
     }
 }

+ 1 - 0
FCS.Crawler/FCS.Crawler.csproj

@@ -216,6 +216,7 @@
       <SubType>Designer</SubType>
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>
+    <Content Include="服务器调度配置.txt" />
   </ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\FCS.Common\FCS.Common.csproj">

+ 6 - 8
FCS.Crawler/Program.cs

@@ -28,14 +28,12 @@ namespace FCS.Crawler
         /// </summary>
         private static void Main()
         {
-            //GamesJob job = new GamesJob();
-            //job.Click();
-            //ServiceBase[] ServicesToRun;
-          //  ServicesToRun = new ServiceBase[]
-           //  {
-           //            new Service1()
-           //   };
-           // ServiceBase.Run(ServicesToRun);
+            ServiceBase[] ServicesToRun;
+            ServicesToRun = new ServiceBase[]
+            {
+                        new Service1()
+             };
+            ServiceBase.Run(ServicesToRun);
             //new AgainstJob().Click();
         }
 

+ 2 - 0
FCS.Crawler/服务器调度配置.txt

@@ -0,0 +1,2 @@
+101.132.158.12   UpdateJob  篮球更新   Update_RealTimeJob 足球(比赛、比赛详情、比分、对阵、当天赔率)  张翔、李果、李亚玲 
+本地电脑         Update_RealTimeJobToDay10 10天赔率     Update_PlayerJob 足球排行、足球球队、球员    李果、李亚玲