KingOfSat.cs
changeset 3 01a00603ec28
parent 1 f203331a8f4a
child 4 8372aa8d6292
     1.1 --- a/KingOfSat.cs	Fri May 15 15:16:18 2015 +0200
     1.2 +++ b/KingOfSat.cs	Fri May 15 17:28:51 2015 +0200
     1.3 @@ -21,7 +21,7 @@
     1.4  		//
     1.5  		// Return:
     1.6  		//   List of channels parsed.		
     1.7 -		public static List<Channel> Parse(string aUrl)
     1.8 +		public static List<Channel> Parse(string aUrl, string aOrbitalPosition)
     1.9  		{
    1.10  			string kos = new WebClient().DownloadString(aUrl);
    1.11  			//Debug.Write(kos);
    1.12 @@ -39,7 +39,12 @@
    1.13  				Channel common = new Channel();
    1.14  
    1.15  				//Parse channel details
    1.16 -				common.OrbitalPosition = WebUtility.HtmlDecode(frq.Cq().Find("tbody > tr > td > a > font").Get(0).InnerText);
    1.17 +				common.OrbitalPosition = WebUtility.HtmlDecode(frq.Cq().Find("tbody > tr > td > a > font").Get(0).InnerText).Trim();
    1.18 +			    if (common.OrbitalPosition != aOrbitalPosition)
    1.19 +			    {
    1.20 +                    //Wrong sat, skip
    1.21 +			        continue;
    1.22 +			    }
    1.23  				common.Satellite = WebUtility.HtmlDecode(frq.Cq().Find("tbody > tr > td:nth-child(2) > a").Get(0).InnerText);
    1.24  				common.Frequency = WebUtility.HtmlDecode(frq.Cq().Find("tbody > tr > td:nth-child(3)").Get(0).InnerText);
    1.25  				common.Polarisation = WebUtility.HtmlDecode(frq.Cq().Find("tbody > tr > td:nth-child(4)").Get(0).InnerText);
    1.26 @@ -82,7 +87,7 @@
    1.27  				{
    1.28  					Channel channel = new Channel();
    1.29  					//Initialize this channel with common properties on this frequency
    1.30 -					channel = common;
    1.31 +                    channel.Copy(common);
    1.32  
    1.33  					//Try and parse channel name
    1.34  					CQ cqChannelName = row.Cq().Find("td:nth-child(3) > a");