• R/O
  • SSH
  • HTTPS

openpishcrawler: Commit


Commit MetaInfo

Revision8 (tree)
Time2019-11-14 07:17:54
Authorsebastiandotnet

Log Message

- update 410 sleep status code

Change Summary

Incremental Difference

--- OpenPishCrawler/Service/OpenPishService.cs (revision 7)
+++ OpenPishCrawler/Service/OpenPishService.cs (revision 8)
@@ -1,5 +1,6 @@
11 using System;
22 using OpenPishCrawler.Data;
3+using System.Linq;
34
45 namespace OpenPishCrawler.Service
56 {
--- OpenPishCrawler/Service/OpenPishSleep.cs (revision 7)
+++ OpenPishCrawler/Service/OpenPishSleep.cs (revision 8)
@@ -24,14 +24,11 @@
2424 throw new ArgumentNullException(nameof(page));
2525
2626 ReadPageDocument(page.Url);
27- //var sleepy = document.DocumentNode.FirstChild.ChildNodes.FirstOrDefault(e => e.Name == "body")?
28- // .ChildNodes.FirstOrDefault(e => e.Name == "div")?
29- // .ChildNodes.FirstOrDefault(e => e.Name == "div");
30- //result = sleepy?.InnerText == "Website is sleeping.";
3127 }
3228 catch (WebException exception)
3329 {
34- result = true == exception.Message?.Contains("403");
30+ result = true == exception.Message?.Contains("403")
31+ || true == exception.Message?.Contains("410");
3532 }
3633 catch
3734 {
--- OpenPishCrawler/MainForm.Designer.cs (revision 7)
+++ OpenPishCrawler/MainForm.Designer.cs (revision 8)
@@ -31,22 +31,27 @@
3131 this.StateCheckBox = new System.Windows.Forms.CheckBox();
3232 this.MainTabControl = new System.Windows.Forms.TabControl();
3333 this.WebhostappPage = new System.Windows.Forms.TabPage();
34- this.PishDataGridView = new OpenPishCrawler.Controls.WebhostAppDataGridview();
3534 this.SuspendedPage = new System.Windows.Forms.TabPage();
36- this.SuspendedDataGridView = new OpenPishCrawler.Controls.SuspendedDataGridView();
37- this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
38- this.dataGridViewButtonColumn1 = new System.Windows.Forms.DataGridViewButtonColumn();
3935 this.ErrorCountLabel = new System.Windows.Forms.Label();
4036 this.ErrorCountHeaderLabel = new System.Windows.Forms.Label();
4137 this.RunCountHeaderLabel = new System.Windows.Forms.Label();
4238 this.RunCountLabel = new System.Windows.Forms.Label();
39+ this.HintLabel = new System.Windows.Forms.Label();
40+ this.MainStatusStrip = new System.Windows.Forms.StatusStrip();
41+ this.Toolstrip1 = new System.Windows.Forms.ToolStripStatusLabel();
42+ this.Toolstrip2 = new System.Windows.Forms.ToolStripStatusLabel();
43+ this.PishDataGridView = new OpenPishCrawler.Controls.WebhostAppDataGridview();
4344 this.UrlColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
4445 this.TargetColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
4546 this.SuspendColumn = new System.Windows.Forms.DataGridViewButtonColumn();
47+ this.SuspendedDataGridView = new OpenPishCrawler.Controls.SuspendedDataGridView();
48+ this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
49+ this.dataGridViewButtonColumn1 = new System.Windows.Forms.DataGridViewButtonColumn();
4650 this.MainTabControl.SuspendLayout();
4751 this.WebhostappPage.SuspendLayout();
52+ this.SuspendedPage.SuspendLayout();
53+ this.MainStatusStrip.SuspendLayout();
4854 ((System.ComponentModel.ISupportInitialize)(this.PishDataGridView)).BeginInit();
49- this.SuspendedPage.SuspendLayout();
5055 ((System.ComponentModel.ISupportInitialize)(this.SuspendedDataGridView)).BeginInit();
5156 this.SuspendLayout();
5257 //
@@ -77,6 +82,7 @@
7782 //
7883 // WebhostappPage
7984 //
85+ this.WebhostappPage.Controls.Add(this.MainStatusStrip);
8086 this.WebhostappPage.Controls.Add(this.PishDataGridView);
8187 this.WebhostappPage.Location = new System.Drawing.Point(4, 25);
8288 this.WebhostappPage.Margin = new System.Windows.Forms.Padding(0);
@@ -86,29 +92,6 @@
8692 this.WebhostappPage.Text = "000webhostapp";
8793 this.WebhostappPage.UseVisualStyleBackColor = true;
8894 //
89- // PishDataGridView
90- //
91- this.PishDataGridView.AllowUserToAddRows = false;
92- this.PishDataGridView.AllowUserToDeleteRows = false;
93- this.PishDataGridView.AllowUserToOrderColumns = true;
94- this.PishDataGridView.AllowUserToResizeColumns = false;
95- this.PishDataGridView.AllowUserToResizeRows = false;
96- this.PishDataGridView.BackgroundColor = System.Drawing.SystemColors.Control;
97- this.PishDataGridView.BorderStyle = System.Windows.Forms.BorderStyle.None;
98- this.PishDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
99- this.PishDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
100- this.UrlColumn,
101- this.TargetColumn,
102- this.SuspendColumn});
103- this.PishDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
104- this.PishDataGridView.Location = new System.Drawing.Point(0, 0);
105- this.PishDataGridView.Margin = new System.Windows.Forms.Padding(4);
106- this.PishDataGridView.Name = "PishDataGridView";
107- this.PishDataGridView.PishingPagesDataSource = null;
108- this.PishDataGridView.RowHeadersVisible = false;
109- this.PishDataGridView.Size = new System.Drawing.Size(596, 274);
110- this.PishDataGridView.TabIndex = 1;
111- //
11295 // SuspendedPage
11396 //
11497 this.SuspendedPage.Controls.Add(this.SuspendedDataGridView);
@@ -120,41 +103,6 @@
120103 this.SuspendedPage.Text = "Reported";
121104 this.SuspendedPage.UseVisualStyleBackColor = true;
122105 //
123- // SuspendedDataGridView
124- //
125- this.SuspendedDataGridView.AllowUserToAddRows = false;
126- this.SuspendedDataGridView.AllowUserToDeleteRows = false;
127- this.SuspendedDataGridView.AllowUserToResizeColumns = false;
128- this.SuspendedDataGridView.AllowUserToResizeRows = false;
129- this.SuspendedDataGridView.BackgroundColor = System.Drawing.SystemColors.Control;
130- this.SuspendedDataGridView.BorderStyle = System.Windows.Forms.BorderStyle.None;
131- this.SuspendedDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
132- this.SuspendedDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
133- this.dataGridViewTextBoxColumn1,
134- this.dataGridViewButtonColumn1});
135- this.SuspendedDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
136- this.SuspendedDataGridView.Location = new System.Drawing.Point(0, 0);
137- this.SuspendedDataGridView.MultiSelect = false;
138- this.SuspendedDataGridView.Name = "SuspendedDataGridView";
139- this.SuspendedDataGridView.RowHeadersVisible = false;
140- this.SuspendedDataGridView.Size = new System.Drawing.Size(596, 274);
141- this.SuspendedDataGridView.SuspendedDataSource = null;
142- this.SuspendedDataGridView.TabIndex = 0;
143- //
144- // dataGridViewTextBoxColumn1
145- //
146- this.dataGridViewTextBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
147- this.dataGridViewTextBoxColumn1.DataPropertyName = "Url";
148- this.dataGridViewTextBoxColumn1.HeaderText = "Url";
149- this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
150- this.dataGridViewTextBoxColumn1.ReadOnly = true;
151- //
152- // dataGridViewButtonColumn1
153- //
154- this.dataGridViewButtonColumn1.HeaderText = "Remove";
155- this.dataGridViewButtonColumn1.Name = "dataGridViewButtonColumn1";
156- this.dataGridViewButtonColumn1.UseColumnTextForButtonValue = true;
157- //
158106 // ErrorCountLabel
159107 //
160108 this.ErrorCountLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
@@ -196,6 +144,66 @@
196144 this.RunCountLabel.TabIndex = 8;
197145 this.RunCountLabel.Text = "0";
198146 //
147+ // HintLabel
148+ //
149+ this.HintLabel.AutoSize = true;
150+ this.HintLabel.ForeColor = System.Drawing.Color.Gray;
151+ this.HintLabel.Location = new System.Drawing.Point(92, 18);
152+ this.HintLabel.Name = "HintLabel";
153+ this.HintLabel.Size = new System.Drawing.Size(149, 16);
154+ this.HintLabel.TabIndex = 9;
155+ this.HintLabel.Text = "(Run every 90 seconds)";
156+ //
157+ // MainStatusStrip
158+ //
159+ this.MainStatusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
160+ this.Toolstrip1,
161+ this.Toolstrip2});
162+ this.MainStatusStrip.Location = new System.Drawing.Point(0, 252);
163+ this.MainStatusStrip.Name = "MainStatusStrip";
164+ this.MainStatusStrip.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional;
165+ this.MainStatusStrip.Size = new System.Drawing.Size(596, 22);
166+ this.MainStatusStrip.TabIndex = 2;
167+ this.MainStatusStrip.Text = "statusStrip1";
168+ //
169+ // Toolstrip1
170+ //
171+ this.Toolstrip1.ForeColor = System.Drawing.Color.Gray;
172+ this.Toolstrip1.Name = "Toolstrip1";
173+ this.Toolstrip1.Size = new System.Drawing.Size(182, 17);
174+ this.Toolstrip1.Text = "Double click to open target page.";
175+ //
176+ // Toolstrip2
177+ //
178+ this.Toolstrip2.ForeColor = System.Drawing.Color.Gray;
179+ this.Toolstrip2.Name = "Toolstrip2";
180+ this.Toolstrip2.Size = new System.Drawing.Size(368, 17);
181+ this.Toolstrip2.Spring = true;
182+ this.Toolstrip2.Text = "Click on Reported to mark the page as reported.";
183+ //
184+ // PishDataGridView
185+ //
186+ this.PishDataGridView.AllowUserToAddRows = false;
187+ this.PishDataGridView.AllowUserToDeleteRows = false;
188+ this.PishDataGridView.AllowUserToOrderColumns = true;
189+ this.PishDataGridView.AllowUserToResizeColumns = false;
190+ this.PishDataGridView.AllowUserToResizeRows = false;
191+ this.PishDataGridView.BackgroundColor = System.Drawing.SystemColors.Control;
192+ this.PishDataGridView.BorderStyle = System.Windows.Forms.BorderStyle.None;
193+ this.PishDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
194+ this.PishDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
195+ this.UrlColumn,
196+ this.TargetColumn,
197+ this.SuspendColumn});
198+ this.PishDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
199+ this.PishDataGridView.Location = new System.Drawing.Point(0, 0);
200+ this.PishDataGridView.Margin = new System.Windows.Forms.Padding(4);
201+ this.PishDataGridView.Name = "PishDataGridView";
202+ this.PishDataGridView.PishingPagesDataSource = null;
203+ this.PishDataGridView.RowHeadersVisible = false;
204+ this.PishDataGridView.Size = new System.Drawing.Size(596, 274);
205+ this.PishDataGridView.TabIndex = 1;
206+ //
199207 // UrlColumn
200208 //
201209 this.UrlColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
@@ -218,11 +226,47 @@
218226 this.SuspendColumn.Name = "SuspendColumn";
219227 this.SuspendColumn.UseColumnTextForButtonValue = true;
220228 //
229+ // SuspendedDataGridView
230+ //
231+ this.SuspendedDataGridView.AllowUserToAddRows = false;
232+ this.SuspendedDataGridView.AllowUserToDeleteRows = false;
233+ this.SuspendedDataGridView.AllowUserToResizeColumns = false;
234+ this.SuspendedDataGridView.AllowUserToResizeRows = false;
235+ this.SuspendedDataGridView.BackgroundColor = System.Drawing.SystemColors.Control;
236+ this.SuspendedDataGridView.BorderStyle = System.Windows.Forms.BorderStyle.None;
237+ this.SuspendedDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
238+ this.SuspendedDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
239+ this.dataGridViewTextBoxColumn1,
240+ this.dataGridViewButtonColumn1});
241+ this.SuspendedDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
242+ this.SuspendedDataGridView.Location = new System.Drawing.Point(0, 0);
243+ this.SuspendedDataGridView.MultiSelect = false;
244+ this.SuspendedDataGridView.Name = "SuspendedDataGridView";
245+ this.SuspendedDataGridView.RowHeadersVisible = false;
246+ this.SuspendedDataGridView.Size = new System.Drawing.Size(596, 277);
247+ this.SuspendedDataGridView.SuspendedDataSource = null;
248+ this.SuspendedDataGridView.TabIndex = 0;
249+ //
250+ // dataGridViewTextBoxColumn1
251+ //
252+ this.dataGridViewTextBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
253+ this.dataGridViewTextBoxColumn1.DataPropertyName = "Url";
254+ this.dataGridViewTextBoxColumn1.HeaderText = "Url";
255+ this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
256+ this.dataGridViewTextBoxColumn1.ReadOnly = true;
257+ //
258+ // dataGridViewButtonColumn1
259+ //
260+ this.dataGridViewButtonColumn1.HeaderText = "Remove";
261+ this.dataGridViewButtonColumn1.Name = "dataGridViewButtonColumn1";
262+ this.dataGridViewButtonColumn1.UseColumnTextForButtonValue = true;
263+ //
221264 // MainForm
222265 //
223266 this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
224267 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
225268 this.ClientSize = new System.Drawing.Size(605, 355);
269+ this.Controls.Add(this.HintLabel);
226270 this.Controls.Add(this.RunCountLabel);
227271 this.Controls.Add(this.RunCountHeaderLabel);
228272 this.Controls.Add(this.ErrorCountHeaderLabel);
@@ -235,8 +279,11 @@
235279 this.Text = "OpenPish Crawler";
236280 this.MainTabControl.ResumeLayout(false);
237281 this.WebhostappPage.ResumeLayout(false);
282+ this.WebhostappPage.PerformLayout();
283+ this.SuspendedPage.ResumeLayout(false);
284+ this.MainStatusStrip.ResumeLayout(false);
285+ this.MainStatusStrip.PerformLayout();
238286 ((System.ComponentModel.ISupportInitialize)(this.PishDataGridView)).EndInit();
239- this.SuspendedPage.ResumeLayout(false);
240287 ((System.ComponentModel.ISupportInitialize)(this.SuspendedDataGridView)).EndInit();
241288 this.ResumeLayout(false);
242289 this.PerformLayout();
@@ -259,6 +306,10 @@
259306 private System.Windows.Forms.DataGridViewTextBoxColumn UrlColumn;
260307 private System.Windows.Forms.DataGridViewTextBoxColumn TargetColumn;
261308 private System.Windows.Forms.DataGridViewButtonColumn SuspendColumn;
309+ private System.Windows.Forms.Label HintLabel;
310+ private System.Windows.Forms.StatusStrip MainStatusStrip;
311+ private System.Windows.Forms.ToolStripStatusLabel Toolstrip1;
312+ private System.Windows.Forms.ToolStripStatusLabel Toolstrip2;
262313 }
263314 }
264315
Show on old repository browser