KingOfSat.cs
changeset 8 adff2dec03a0
parent 7 bf908f6c7758
child 9 b77b09f680e7
     1.1 --- a/KingOfSat.cs	Sun May 17 20:35:37 2015 +0200
     1.2 +++ b/KingOfSat.cs	Thu Oct 04 19:25:35 2018 +0200
     1.3 @@ -41,7 +41,7 @@
     1.4                  Channel common = new Channel();
     1.5  
     1.6                  //Parse channel details
     1.7 -                common.OrbitalPosition = WebUtility.HtmlDecode(frq.Cq().Find("tbody > tr > td > a > font").Get(0).InnerText).Trim();
     1.8 +                common.OrbitalPosition = WebUtility.HtmlDecode(frq.Cq().Find("tbody > tr > td")?.Get(0).InnerText).Trim();
     1.9                  if (common.OrbitalPosition != aOrbitalPosition)
    1.10                  {
    1.11                      //Wrong sat, skip
    1.12 @@ -71,10 +71,10 @@
    1.13                  }
    1.14                  //
    1.15                  common.NetworkID = WebUtility.HtmlDecode(frq.Cq().Find("tbody > tr > td:nth-child(11)").Get(0).InnerText);
    1.16 -                common.NetworkID = common.NetworkID.Substring("NID:".Length, common.NetworkID.Length - "NID:".Length);
    1.17 +                //common.NetworkID = common.NetworkID.Substring("NID:".Length, common.NetworkID.Length - "NID:".Length);
    1.18                  //
    1.19                  common.TransponderID = WebUtility.HtmlDecode(frq.Cq().Find("tbody > tr > td:nth-child(12)").Get(0).InnerText);
    1.20 -                common.TransponderID = common.TransponderID.Substring("TID:".Length, common.TransponderID.Length - "TID:".Length);
    1.21 +                //common.TransponderID = common.TransponderID.Substring("TID:".Length, common.TransponderID.Length - "TID:".Length);
    1.22  
    1.23                  //We got common properties for the coming channels
    1.24                  //Debug.Write(common.ToString());
    1.25 @@ -115,11 +115,11 @@
    1.26                          channelName = cqChannelName.Get(0).InnerText;
    1.27                      }
    1.28  
    1.29 -                    //We spend a lot of time trying to get this right until we found our answer in the following thread.
    1.30 -                    //http://stackoverflow.com/questions/14057434/how-can-i-transform-string-to-utf-8-in-c
    1.31                      //Decode HTML
    1.32                      channel.Name = WebUtility.HtmlDecode(channelName);
    1.33                      //Convert from default encoding to UTF8
    1.34 +                    //We spend a lot of time trying to get this right until we found our answer in the following thread.
    1.35 +                    //http://stackoverflow.com/questions/14057434/how-can-i-transform-string-to-utf-8-in-c
    1.36                      byte[] bytes = Encoding.Default.GetBytes(channel.Name);
    1.37                      channel.Name = Encoding.UTF8.GetString(bytes);
    1.38