Пример #1
0
 private decimal Stock(string linkGraph)
 {
     ClearLists();
     foreach (Match match in Regex.Matches(TakeHtml(linkGraph), @";\d+.n(.*?);(.*?);"))
     {
         DateTime dateTime = new DateTime(1970, 1, 1).AddSeconds(Convert.ToInt32(match.Groups[1].Value));
         ListTimeCourse.Add(dateTime);
         CurrentCourse = Convert.ToDecimal(match.Groups[2].Value.Replace(".", ","));
         ListCourse.Add(Convert.ToDouble(CurrentCourse));
     }
     return(CurrentCourse);
 }
Пример #2
0
 private decimal Crypto(string linkGraph)
 {
     ClearLists();
     foreach (Match match in Regex.Matches(TakeHtml(linkGraph), @".new Date.'(.*?)'., (.*?)]"))
     {
         DateTime dateTime = DateTime.ParseExact(match.Groups[1].Value, "yyyy-M-dd HH:mm:ss.fff", null);
         ListTimeCourse.Add(dateTime);
         ListCourse.Add(Convert.ToDouble(match.Groups[2].Value.Replace(".", ",")));
         CurrentCourse = Convert.ToDecimal(match.Groups[2].Value.Replace(".", ","));
     }
     return(CurrentCourse);
 }
Пример #3
0
 private decimal Currency(string linkGraph)
 {
     ClearLists();
     foreach (Match match in Regex.Matches(TakeHtml(linkGraph), @", .(\d+), (.*?)]"))
     {
         DateTime dateTime = DateTimeOffset.FromUnixTimeMilliseconds(Convert.ToInt64(match.Groups[1].Value)).DateTime;
         ListTimeCourse.Add(dateTime);
         ListCourse.Add(Convert.ToDouble(match.Groups[2].Value.Replace(".", ",")));
         CurrentCourse = Convert.ToDecimal(match.Groups[2].Value.Replace(".", ","));
     }
     return(CurrentCourse);
 }
Пример #4
0
        private decimal Metals(string linkGraph, int numMetal)
        {
            ClearLists();
            Regex r = new Regex("date'>(.*?)<td>(.*?)<td>(.*?)<td>(.*?)<td>(.*?)<tr>");

            Match m = r.Match(TakeHtml(linkGraph));

            while (m.Success)
            {
                ListTimeCourse.Add(Convert.ToDateTime(m.Groups[1].Value));
                ListCourse.Add(Convert.ToDouble(m.Groups[numMetal].Value.Replace(".", ",")));
                m = m.NextMatch();
            }
            ListCourse.Reverse();
            ListTimeCourse.Reverse();
            CurrentCourse = Convert.ToDecimal(ListCourse[ListCourse.Count - 2]);
            return(CurrentCourse);
        }