이전 날짜 처리 추가

This commit is contained in:
2016-07-15 01:02:08 +09:00
parent ebcdf9b7ea
commit b35ec4e09a
2 changed files with 165 additions and 150 deletions

1
Form1.Designer.cs generated
View File

@@ -59,6 +59,7 @@
this.lvList.Dock = System.Windows.Forms.DockStyle.Fill; this.lvList.Dock = System.Windows.Forms.DockStyle.Fill;
this.lvList.FullRowSelect = true; this.lvList.FullRowSelect = true;
this.lvList.GridLines = true; this.lvList.GridLines = true;
this.lvList.HideSelection = false;
this.lvList.Location = new System.Drawing.Point(0, 0); this.lvList.Location = new System.Drawing.Point(0, 0);
this.lvList.MultiSelect = false; this.lvList.MultiSelect = false;
this.lvList.Name = "lvList"; this.lvList.Name = "lvList";

View File

@@ -72,6 +72,14 @@ namespace NewsCrawler
string strTime = item.SelectSingleNode(".//span").InnerText; string strTime = item.SelectSingleNode(".//span").InnerText;
string strURL = strServerURL+item.SelectSingleNode(".//a").GetAttributeValue("href", ""); string strURL = strServerURL+item.SelectSingleNode(".//a").GetAttributeValue("href", "");
if (Regex.IsMatch(strTime, @"\d+/\d+") == true)
{
//Console.WriteLine("어제 기사 : " + item.InnerHtml);
continue;
}
if (m_ItemList.Any(c => c.m_strURL==strURL)==false) if (m_ItemList.Any(c => c.m_strURL==strURL)==false)
{ {
NEWS_ITEM news = new NEWS_ITEM(); NEWS_ITEM news = new NEWS_ITEM();
@@ -119,6 +127,12 @@ namespace NewsCrawler
string strURL = item.SelectSingleNode(".//a").GetAttributeValue("href", ""); string strURL = item.SelectSingleNode(".//a").GetAttributeValue("href", "");
strURL = "http://www.etoday.co.kr/news/section/newsview.php?idxno="+Regex.Replace(strURL, @"\D", ""); strURL = "http://www.etoday.co.kr/news/section/newsview.php?idxno="+Regex.Replace(strURL, @"\D", "");
if (Regex.IsMatch(strTime, @"\d+/\d+") == true)
{
//Console.WriteLine("어제 기사 : " + item.InnerHtml);
continue;
}
if (m_ItemList.Any(c => c.m_strURL==strURL)==false) if (m_ItemList.Any(c => c.m_strURL==strURL)==false)
{ {
NEWS_ITEM news = new NEWS_ITEM(); NEWS_ITEM news = new NEWS_ITEM();