Esempio n. 1
0
        //알림
        public void fnAlarm()
        {
            List <string> GetInfoList = new List <string>();
            string        strFindOK   = "";

            GetInfoList = Paser.GetInfo(mURL, mStartStr, mLastStr);

            if (GetInfoList.Count < 1)
            {
                Log.Info(string.Format("fnAlarm() : 파싱된 정보가 없음"));
            }

            TimeSpan ts;

            for (int i = 0; i < mSearchedItem.Count; i++)
            {
                //검색된 리스트는 하루 지나면 삭제
                ts = DateTime.Now - mSearchedItem[i].dtAddDate;
                if (ts.Days > 0)
                {
                    mSearchedItem.RemoveAt(i);
                    i--;
                    continue;
                }

                //이미 검색된 거라면 보낼 메세지에서 제거
                for (int x = 0; x < GetInfoList.Count; x++)
                {
                    if (GetInfoList[x].Contains(mSearchedItem[i].sItem))
                    {
                        GetInfoList.RemoveAt(x);
                        x--;
                    }
                }
            }

            foreach (string wantToFind in mFindGoods)
            {
                for (int i = 0; i < GetInfoList.Count; i++)
                {
                    if (GetInfoList[i].Contains(wantToFind.ToUpper()))    //무조건 대문자로 변환
                    {
                        strFindOK += GetInfoList[i] + Environment.NewLine;
                        stSearched searched = new stSearched(GetInfoList[i], DateTime.Now);
                        mSearchedItem.Add(searched);
                    }
                }
            }

            if (mSearchedItem.Count > 100)
            {
                mSearchedItem.RemoveRange(0, 50);
            }

            if (strFindOK != "")
            {
                Telegram_Bot.Telegram_Send(strFindOK);
                //fnMailSend(strFindOK);
            }
        }
Esempio n. 2
0
        //내용확인버튼
        private void ViewCurrent()
        {
            //List<string> liInfo = Paser.GetInfo(mURL, mStartStr, mLastStr);
            List <string> liFindWhat = new List <string>();

            liFindWhat.Add(mStartStr + "|&|" + mLastStr);
            liFindWhat.Add("'eng list_vspace' colspan=2  title=" + "|&|" + ">");

            List <string> liInfo = Paser.GetHtmlInfo(mURL, liFindWhat);

            string strInfo = "";

            for (int i = 0; i < liInfo.Count; i++)
            {
                strInfo += liInfo[i] + Environment.NewLine + Environment.NewLine;
            }

            //MessageBox.Show(strInfo);
        }