# HG changeset patch # User StephaneLenclud # Date 1431636197 -7200 # Node ID 1d43448724954d06e2aa1247d266045a777a917f First drop. Basic Sky Deutschland package frequency parssing. diff -r 000000000000 -r 1d4344872495 App.config --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/App.config Thu May 14 22:43:17 2015 +0200 @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff -r 000000000000 -r 1d4344872495 Channel.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Channel.cs Thu May 14 22:43:17 2015 +0200 @@ -0,0 +1,82 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; + +namespace SatChanGen +{ + class Channel + { + //19.2E + public string OrbitalPosition { get; set; } + //Astra 1M + public string Satellite { get; set; } + //10773.25 + public string Frequency { get; set; } + //Horizontal/Vertical + public string Polarisation { get; set; } + //53 + public string Transponder { get; set; } + //Astra 1M + public string Beam { get; set; } + //DVB-S2 + public string Standard { get; set; } + //8PSK + public string Modulation { get; set; } + //22000 + public string SymbolRate { get; set; } + //3/4 + public string FEC { get; set; } + //ASTRA 1 + public string Provider { get; set; } + //47.9 Mbps + public string Bitrate { get; set; } + //1 + public string NetworkID { get; set; } + //1053 + public string TransponderID { get; set; } + //------------------------------------------------------ + //Sky Atlantic HD + public string Name { get; set; } + //Germany + public string Country { get; set; } + //Entertainment + public string Category { get; set; } + //Sky Deutschland + public string Packages { get; set; } + // + public string Encryption { get; set; } + // + public string SID { get; set; } + // + public string VPID { get; set; } + // + public string Audio { get; set; } + // + public string PMT { get; set; } + // + public string PCR { get; set; } + // + public string TXT { get; set; } + + ////// + public override string ToString() + { + string res = ""; + PropertyInfo[] properties = typeof(Channel).GetProperties(); + foreach (PropertyInfo property in properties) + { + object value = property.GetValue(this); + if (value is string) + { + res += property.Name + ": " + value + "\n"; + } + } + + return res; + } + } +} diff -r 000000000000 -r 1d4344872495 MainForm.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MainForm.Designer.cs Thu May 14 22:43:17 2015 +0200 @@ -0,0 +1,61 @@ +namespace SatChanGen +{ + partial class MainForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.buttonGenerate = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // buttonGenerate + // + this.buttonGenerate.Location = new System.Drawing.Point(192, 138); + this.buttonGenerate.Name = "buttonGenerate"; + this.buttonGenerate.Size = new System.Drawing.Size(75, 23); + this.buttonGenerate.TabIndex = 0; + this.buttonGenerate.Text = "Generate"; + this.buttonGenerate.UseVisualStyleBackColor = true; + this.buttonGenerate.Click += new System.EventHandler(this.buttonGenerate_Click); + // + // MainForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(727, 521); + this.Controls.Add(this.buttonGenerate); + this.Name = "MainForm"; + this.Text = "Sattelite Channel Generator"; + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button buttonGenerate; + } +} + diff -r 000000000000 -r 1d4344872495 MainForm.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MainForm.cs Thu May 14 22:43:17 2015 +0200 @@ -0,0 +1,110 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using CsQuery; +using System.Diagnostics; +using System.Net; + + + +namespace SatChanGen +{ + public partial class MainForm : Form + { + public MainForm() + { + InitializeComponent(); + } + + private void buttonGenerate_Click(object sender, EventArgs e) + { + + string kos = new WebClient().DownloadString("http://en.kingofsat.net/pack-skygermany.php"); + //Debug.Write(kos); + + CQ dom = kos; + + //Get all the Frequency elements in our page + CQ sats = dom[".frq"]; + + foreach (IDomObject frq in sats.ToList()) + { + Debug.Write("=====================\n"); + Channel common=new Channel(); + + //Parse channel details + common.OrbitalPosition = WebUtility.HtmlDecode(frq.Cq().Find("tbody > tr > td > a > font").Get(0).InnerText); + common.Satellite = WebUtility.HtmlDecode(frq.Cq().Find("tbody > tr > td:nth-child(2) > a").Get(0).InnerText); + common.Frequency = WebUtility.HtmlDecode(frq.Cq().Find("tbody > tr > td:nth-child(3)").Get(0).InnerText); + common.Polarisation = WebUtility.HtmlDecode(frq.Cq().Find("tbody > tr > td:nth-child(4)").Get(0).InnerText); + common.Transponder = WebUtility.HtmlDecode(frq.Cq().Find("tbody > tr > td:nth-child(5) > a").Get(0).InnerText); + common.Beam = WebUtility.HtmlDecode(frq.Cq().Find("tbody > tr > td:nth-child(6) > a").Get(0).InnerText); + common.Standard = WebUtility.HtmlDecode(frq.Cq().Find("tbody > tr > td:nth-child(7)").Get(0).InnerText); + common.Modulation = WebUtility.HtmlDecode(frq.Cq().Find("tbody > tr > td:nth-child(8)").Get(0).InnerText); + common.SymbolRate = WebUtility.HtmlDecode(frq.Cq().Find("tbody > tr > td:nth-child(9) > a").Get(0).InnerText); + common.FEC = WebUtility.HtmlDecode(frq.Cq().Find("tbody > tr > td:nth-child(9) > a:nth-child(2)").Get(0).InnerText); + try + { + common.Provider = WebUtility.HtmlDecode(frq.Cq().Find("tbody > tr > td:nth-child(10) > b").Get(0).InnerText); + } + catch (Exception) + { + } + + common.Bitrate = WebUtility.HtmlDecode(frq.Cq().Find("tbody > tr > td:nth-child(10)").Get(0).InnerText); + if (common.Bitrate.Substring(0, ", ".Length) == ", ") + { + common.Bitrate = common.Bitrate.Substring(", ".Length, common.Bitrate.Length - ", ".Length); + } + // + common.NetworkID = WebUtility.HtmlDecode(frq.Cq().Find("tbody > tr > td:nth-child(11)").Get(0).InnerText); + common.NetworkID = common.NetworkID.Substring("NID:".Length, common.NetworkID.Length - "NID:".Length); + // + common.TransponderID = WebUtility.HtmlDecode(frq.Cq().Find("tbody > tr > td:nth-child(12)").Get(0).InnerText); + common.TransponderID = common.TransponderID.Substring("TID:".Length, common.TransponderID.Length - "TID:".Length); + + //Now get all the channels for that frequency + //Channel common = new Channel(); + + + Debug.Write(common.ToString()); + + } + + //Debug.Write(sats.Text()); + + /* + CQ dom = "
Hello world! I am feeling bold! What about you?
"; + + + CQ bold = dom["b"]; /// find all "b" nodes (there are two in this example) + + + //> bold.ToList() + //> Count = 2 + //> [0]: {...} + //> [1]: {...} + + //> bold.First().RenderSelection() + //> "I am feeling bold!" + + string boldText = bold.Text(); /// jQuery text method; + + //> boldText + //> "I am feeling bold! you?" + + bold.Remove(); /// jQuery Remove method + + string html = dom.Render(); + + Debug.Write(html); + */ + } + } +} diff -r 000000000000 -r 1d4344872495 MainForm.resx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MainForm.resx Thu May 14 22:43:17 2015 +0200 @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff -r 000000000000 -r 1d4344872495 Program.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Program.cs Thu May 14 22:43:17 2015 +0200 @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace SatChanGen +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new MainForm()); + } + } +} diff -r 000000000000 -r 1d4344872495 Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Properties/AssemblyInfo.cs Thu May 14 22:43:17 2015 +0200 @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("SatChanGen")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("SatChanGen")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("925f5c5b-b813-4fd4-8e5e-19f7ae8423a6")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff -r 000000000000 -r 1d4344872495 Properties/Resources.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Properties/Resources.Designer.cs Thu May 14 22:43:17 2015 +0200 @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18408 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace SatChanGen.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SatChanGen.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff -r 000000000000 -r 1d4344872495 Properties/Resources.resx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Properties/Resources.resx Thu May 14 22:43:17 2015 +0200 @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff -r 000000000000 -r 1d4344872495 Properties/Settings.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Properties/Settings.Designer.cs Thu May 14 22:43:17 2015 +0200 @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18408 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace SatChanGen.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff -r 000000000000 -r 1d4344872495 Properties/Settings.settings --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Properties/Settings.settings Thu May 14 22:43:17 2015 +0200 @@ -0,0 +1,7 @@ + + + + + + + diff -r 000000000000 -r 1d4344872495 SatChanGen.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SatChanGen.csproj Thu May 14 22:43:17 2015 +0200 @@ -0,0 +1,93 @@ + + + + + Debug + AnyCPU + {2308CCC9-1EF8-4BD0-8673-B1DE365736EB} + WinExe + Properties + SatChanGen + SatChanGen + v4.5 + 512 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + packages\CsQuery.1.3.4\lib\net40\CsQuery.dll + + + + + + + + + + + + + + + + Form + + + MainForm.cs + + + + + MainForm.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + \ No newline at end of file diff -r 000000000000 -r 1d4344872495 SatChanGen.sln --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SatChanGen.sln Thu May 14 22:43:17 2015 +0200 @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.31101.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SatChanGen", "SatChanGen.csproj", "{2308CCC9-1EF8-4BD0-8673-B1DE365736EB}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2308CCC9-1EF8-4BD0-8673-B1DE365736EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2308CCC9-1EF8-4BD0-8673-B1DE365736EB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2308CCC9-1EF8-4BD0-8673-B1DE365736EB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2308CCC9-1EF8-4BD0-8673-B1DE365736EB}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff -r 000000000000 -r 1d4344872495 packages.config --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/packages.config Thu May 14 22:43:17 2015 +0200 @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff -r 000000000000 -r 1d4344872495 packages/repositories.config --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/packages/repositories.config Thu May 14 22:43:17 2015 +0200 @@ -0,0 +1,4 @@ + + + + \ No newline at end of file