コード例 #1
0
ファイル: Coins.cs プロジェクト: darkmaycal/CryptoBot
        static public Dictionary <string, TransforfField> GetOrderBook()
        {
            LiveCoinInfo LiveInfo = new LiveCoinInfo();

            string         order = "https://api.livecoin.net/exchange/all/order_book";
            HttpWebRequest req   = (HttpWebRequest)HttpWebRequest.Create(order);
            WebResponse    resp;

            try
            {
                resp = req.GetResponse();
            }
            catch (System.Net.WebException)
            {
                return(null);
            }
            Dictionary <string, TransforfField> temp;

            using (StreamReader stream = new StreamReader(
                       resp.GetResponseStream(), Encoding.UTF8))
            {
                string str = stream.ReadToEnd();
                var    res = JsonConvert.DeserializeObject <Dictionary <string, LiveAndPoloniexField> >(str);
                var    t   = res.Where(y => Cheaker(y) && LiveInfo.StatusCheaker(y.Key.Split('/')[0]));
                temp = t.ToDictionary(x => x.Key, y => new TransforfField(y.Value.asks, y.Value.bids));
            }
            return(temp);
        }