|
@@ -20,9 +20,9 @@ namespace FCS.Crawler.Basketball
|
|
|
/// </summary>
|
|
|
public class B_LeagueRankingJob : CommonJob, IJob
|
|
|
{
|
|
|
- private List<B_LeagueRanking> LeagueRankingList = new List<B_LeagueRanking>();
|
|
|
- private List<DataItemDetail> DateItem = new List<DataItemDetail>();
|
|
|
- private List<B_Team> TeamList = new List<B_Team>();
|
|
|
+ private List<B_LeagueRanking> LeagueRankingList = new List<B_LeagueRanking>();
|
|
|
+ private List<DataItemDetail> DateItem = new List<DataItemDetail>();
|
|
|
+ private List<B_Team> TeamList = new List<B_Team>();
|
|
|
B_LeagueRanking g;
|
|
|
public B_LeagueRankingJob()
|
|
|
{
|
|
@@ -45,7 +45,6 @@ namespace FCS.Crawler.Basketball
|
|
|
{
|
|
|
GetSqlString(GetAllEventUrl, "");
|
|
|
}
|
|
|
-
|
|
|
/// <summary>
|
|
|
/// 更新数据
|
|
|
/// </summary>
|
|
@@ -59,8 +58,16 @@ namespace FCS.Crawler.Basketball
|
|
|
var sql = string.Format(GetNewEventUrl, Year);
|
|
|
GetSqlString(sql, Year);
|
|
|
}
|
|
|
+ /// <summary>
|
|
|
+ /// CBA所有数据
|
|
|
+ /// </summary>
|
|
|
+ public void GetAll_CBA()
|
|
|
+ {
|
|
|
+ GetCBALeagueRanking();
|
|
|
+ }
|
|
|
#endregion
|
|
|
|
|
|
+ #region NBA
|
|
|
/// <summary>
|
|
|
/// 解析数据
|
|
|
/// </summary>
|
|
@@ -196,5 +203,43 @@ namespace FCS.Crawler.Basketball
|
|
|
private static string GetNewEventUrl = @"select distinct EventId,Season,Remark from B_Grouping where Remark is not null and Season like '%{0}%'";
|
|
|
|
|
|
#endregion
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+
|
|
|
+ #region CBA
|
|
|
+
|
|
|
+ private void GetCBALeagueRanking()
|
|
|
+ {
|
|
|
+ int startyear = 5;
|
|
|
+ int endtyear = DateTime.Now.AddYears(1).Year % 100;
|
|
|
+ List<string> Years = new List<string>();
|
|
|
+ //组装时间段
|
|
|
+ while (startyear < endtyear)
|
|
|
+ {
|
|
|
+ int temp = startyear + 1;
|
|
|
+ string Year = (startyear < 10 ? "0" + startyear.ToString() : startyear.ToString()) + "-" + (temp < 10 ? "0" + temp.ToString() : temp.ToString());
|
|
|
+ Years.Add(Year);
|
|
|
+ startyear++;
|
|
|
+ }
|
|
|
+ //获取排行榜
|
|
|
+ foreach (var item in Years)
|
|
|
+ {
|
|
|
+ var url = "http://nba.nowscore.com/jsData/rank/" + item + "/s5.js";
|
|
|
+ var htmlResource = NetHelper.GetUrlResponse(url, Encoding.GetEncoding("utf-8")).Replace(" ", "");
|
|
|
+ if (htmlResource.IsEmpty())
|
|
|
+ return;
|
|
|
+ var arrs = htmlResource.Split(';');
|
|
|
+ var arrLeague = arrs[0].Split('=')[1];
|
|
|
+ var arrTeam = arrs[1].Split('=')[1];
|
|
|
+ var westData = arrs[2].Split('=')[1];
|
|
|
+ var lastUpdateTime = arrs[3].Split('=')[1];
|
|
|
+ var scoreColor = arrs[4].Split('=')[1];
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
}
|
|
|
}
|