MainForm.cs
changeset 1 f203331a8f4a
parent 0 1d4344872495
child 2 d73e99c5333c
     1.1 --- a/MainForm.cs	Thu May 14 22:43:17 2015 +0200
     1.2 +++ b/MainForm.cs	Fri May 15 13:23:52 2015 +0200
     1.3 @@ -24,87 +24,7 @@
     1.4  
     1.5          private void buttonGenerate_Click(object sender, EventArgs e)
     1.6          {
     1.7 -
     1.8 -            string kos = new WebClient().DownloadString("http://en.kingofsat.net/pack-skygermany.php");
     1.9 -            //Debug.Write(kos);
    1.10 -
    1.11 -            CQ dom = kos;
    1.12 -
    1.13 -			//Get all the Frequency elements in our page
    1.14 -            CQ sats = dom[".frq"];
    1.15 -
    1.16 -            foreach (IDomObject frq in sats.ToList())
    1.17 -            {
    1.18 -	            Debug.Write("=====================\n");
    1.19 -	            Channel common=new Channel();
    1.20 -
    1.21 -				//Parse channel details
    1.22 -	            common.OrbitalPosition = WebUtility.HtmlDecode(frq.Cq().Find("tbody > tr > td > a > font").Get(0).InnerText);
    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 -				common.Transponder = WebUtility.HtmlDecode(frq.Cq().Find("tbody > tr > td:nth-child(5) > a").Get(0).InnerText);
    1.27 -				common.Beam = WebUtility.HtmlDecode(frq.Cq().Find("tbody > tr > td:nth-child(6) > a").Get(0).InnerText);
    1.28 -				common.Standard = WebUtility.HtmlDecode(frq.Cq().Find("tbody > tr > td:nth-child(7)").Get(0).InnerText);
    1.29 -				common.Modulation = WebUtility.HtmlDecode(frq.Cq().Find("tbody > tr > td:nth-child(8)").Get(0).InnerText);
    1.30 -				common.SymbolRate = WebUtility.HtmlDecode(frq.Cq().Find("tbody > tr > td:nth-child(9) > a").Get(0).InnerText);
    1.31 -				common.FEC = WebUtility.HtmlDecode(frq.Cq().Find("tbody > tr > td:nth-child(9) > a:nth-child(2)").Get(0).InnerText);
    1.32 -	            try
    1.33 -	            {
    1.34 -					common.Provider = WebUtility.HtmlDecode(frq.Cq().Find("tbody > tr > td:nth-child(10) > b").Get(0).InnerText);
    1.35 -	            }
    1.36 -	            catch (Exception)
    1.37 -	            {			
    1.38 -	            }
    1.39 -
    1.40 -				common.Bitrate = WebUtility.HtmlDecode(frq.Cq().Find("tbody > tr > td:nth-child(10)").Get(0).InnerText);
    1.41 -	            if (common.Bitrate.Substring(0, ", ".Length) == ", ")
    1.42 -	            {
    1.43 -					common.Bitrate = common.Bitrate.Substring(", ".Length, common.Bitrate.Length - ", ".Length);
    1.44 -	            }
    1.45 -				//
    1.46 -				common.NetworkID = WebUtility.HtmlDecode(frq.Cq().Find("tbody > tr > td:nth-child(11)").Get(0).InnerText);
    1.47 -				common.NetworkID = common.NetworkID.Substring("NID:".Length, common.NetworkID.Length - "NID:".Length);
    1.48 -				//
    1.49 -				common.TransponderID = WebUtility.HtmlDecode(frq.Cq().Find("tbody > tr > td:nth-child(12)").Get(0).InnerText);
    1.50 -				common.TransponderID = common.TransponderID.Substring("TID:".Length, common.TransponderID.Length - "TID:".Length);
    1.51 -
    1.52 -				//Now get all the channels for that frequency
    1.53 -				//Channel common = new Channel();
    1.54 -
    1.55 -								
    1.56 -				Debug.Write(common.ToString());
    1.57 -
    1.58 -            }
    1.59 -
    1.60 -            //Debug.Write(sats.Text());
    1.61 -
    1.62 -            /*
    1.63 -            CQ dom = "<div>Hello world! <b>I am feeling bold!</b> What about <b>you?</b></div>";
    1.64 -
    1.65 -
    1.66 -            CQ bold = dom["b"];               /// find all "b" nodes (there are two in this example)
    1.67 -
    1.68 -            
    1.69 -  //> bold.ToList()
    1.70 -  //> Count = 2
    1.71 -  //> [0]: {<b>...</b>}
    1.72 -  //> [1]: {<b>...</b>}
    1.73 -
    1.74 -  //> bold.First().RenderSelection()
    1.75 -  //> "<b>I am feeling bold!</b>"
    1.76 -            
    1.77 -            string boldText = bold.Text();        /// jQuery text method;
    1.78 -
    1.79 -  //> boldText
    1.80 -  //> "I am feeling bold! you?"
    1.81 -
    1.82 -            bold.Remove();                        /// jQuery Remove method
    1.83 -
    1.84 -            string html = dom.Render();
    1.85 -
    1.86 -            Debug.Write(html);
    1.87 -            */
    1.88 +	        List<Channel> channels=KingOfSat.Parse("http://en.kingofsat.net/pack-skygermany.php");
    1.89          }
    1.90      }
    1.91  }