public async Task <IHttpActionResult> CryptoMoneyList()
        {
            Uri URL = new Uri("https://www.doviz.com/kripto-paralar");
            List <Type1Model> currencyList = new List <Type1Model>();
            string            html         = client.DownloadString(URL);

            HtmlDocument document = new HtmlDocument();

            document.LoadHtml(html);
            try
            {
                var tableRow = document.DocumentNode.Descendants("tr");
                int count    = 0;

                foreach (var node in tableRow)
                {
                    var array = node.InnerText.Replace(" ", "").Trim().Split('\n');
                    if (count < 1)
                    {
                        count++;
                    }
                    else
                    {
                        Type1Model model = new Type1Model();
                        model.Name  = _scripts.NameControl(array[0]);
                        model.Buyin = array[3];
                        // model.Sales = _scripts.NameControl(array[4]);    TRY
                        model.Change     = array[8];
                        model.UpdateTime = array[11];

                        count++;
                        currencyList.Add(model);
                    }
                }
            }
            catch (Exception)
            {
                return(Ok("null"));
            }
            ResultModel <Type1Model> result = new ResultModel <Type1Model>
            {
                _Title    = "Crypto Money List",
                _DateTime = DateTime.Now.ToString(),
                _Count    = currencyList.Count,
                _Result   = currencyList
            };


            return(Ok(result));
        }
Exemple #2
0
 protected virtual void AssignAdditionalData(Type1Model type, TypeManager t) {}