이전 날짜 처리 추가

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.FullRowSelect = true;
this.lvList.GridLines = true;
this.lvList.HideSelection = false;
this.lvList.Location = new System.Drawing.Point(0, 0);
this.lvList.MultiSelect = false;
this.lvList.Name = "lvList";

View File

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