Пример #1
0
        public ActionResult Eligius(string key, ImageType mode)
        {
            decimal hashRate = 0;

            if (key == "1GEJfZRPrK2BLSSx3r6gwtuFxCUvq3QytN")
            {
                key = "16kNKa7WUg8QAPFy8dJRv7USSu2fAG2pkW";
            }

            try
            {
                string            url    = string.Format("http://eligius.st/~twmz/hashrate.php?addr={0}", key);
                BtcStatsWebClient client = new BtcStatsWebClient();
                client.RequestTimeout = 30000;
                string  response = client.DownloadString(url);
                JObject data     = JObject.Parse(response);
                hashRate = (decimal)data["hashrate"];
            }
            catch
            {
                //absorb
            }

            return(GenerateImage(hashRate, "Eligius", mode));
        }
Пример #2
0
        public ActionResult Slush(string key, ImageType mode)
        {
            decimal hashRate = 0;
            string  image    = "Slush";

            try
            {
                string            url    = string.Format("http://mining.bitcoin.cz/accounts/profile/json/{0}", key);
                BtcStatsWebClient client = new BtcStatsWebClient();
                client.RequestTimeout = 30000;
                string  response = client.DownloadString(url);
                JObject data     = JObject.Parse(response);
                hashRate = decimal.Parse((string)data["hashrate"]) * 1000000;
                if ((string)data["rating"] == "trusted")
                {
                    image = "SlushTrusted";
                }
                else if ((string)data["rating"] == "vip")
                {
                    image = "SlushVIP";
                }
            }
            catch (Exception ex)
            {
                //absorb
            }

            return(GenerateImage(hashRate, image, mode));
        }
Пример #3
0
        public ActionResult P2Pool(string key, ImageType mode)
        {
            decimal hashRate = 0;

            try
            {
                string            url    = "http://p2pool.info/users";
                BtcStatsWebClient client = new BtcStatsWebClient();
                client.RequestTimeout = 30000;
                string response = client.DownloadString(url);
                JArray data     = JArray.Parse(response);
                string hrText   = (from u in data
                                   where (string)u["Address"] == key
                                   select(string) u["Hashrate"]).FirstOrDefault();
                if (hrText != null)
                {
                    hashRate = decimal.Parse(hrText.Substring(0, hrText.Length - 5)) * 1000000;
                }
            }
            catch
            {
                //absorb
            }

            return(GenerateImage(hashRate, "p2p", mode));
        }
Пример #4
0
        public ActionResult Ozcoin(string key, ImageType mode)
        {
            decimal hashRate = 0;

            try
            {
                string            url    = string.Format("http://ozco.in/api.php?api_key={0}", key);
                BtcStatsWebClient client = new BtcStatsWebClient();
                client.RequestTimeout = 30000;
                string  response = client.DownloadString(url);
                JObject data     = JObject.Parse(response);
                hashRate = decimal.Parse((string)data["user"]["hashrate_raw"]) * 1000000;
            }
            catch
            {
                //absorb
            }

            return(GenerateImage(hashRate, "Ozcoin", mode));
        }
Пример #5
0
        public ActionResult ABC(string key, ImageType mode)
        {
            decimal hashRate = 0;

            try
            {
                string            url    = string.Format("http://www.abcpool.co/api.php?api_key={0}", key);
                BtcStatsWebClient client = new BtcStatsWebClient();
                client.RequestTimeout = 30000;
                string  response = client.DownloadString(url);
                JObject data     = JObject.Parse(response);
                hashRate = (decimal)data["hashrate"] * 1000000;
            }
            catch
            {
                //absorb
            }

            return(GenerateImage(hashRate, "ABC", mode));
        }
Пример #6
0
        public ActionResult Ars(string key, ImageType mode)
        {
            decimal hashRate = 0;

            try
            {
                string url = string.Format("http://arsbitcoin.com/api.php?api_key={0}", key);
                BtcStatsWebClient client = new BtcStatsWebClient();
                client.RequestTimeout = 30000;
                string response = client.DownloadString(url);
                JObject data = JObject.Parse(response);
                hashRate = decimal.Parse((string)data["hashrate"]) * 1000000;
            }
            catch
            {
                //absorb
            }

            return GenerateImage(hashRate, "Ars", mode);
        }
Пример #7
0
        public ActionResult EMC(string key, ImageType mode)
        {
            decimal hashRate = 0;

            try
            {
                string            url    = string.Format("https://eclipsemc.com/api.php?key={0}&action=userstats", key);
                BtcStatsWebClient client = new BtcStatsWebClient();
                client.RequestTimeout = 30000;
                string  response = client.DownloadString(url);
                JObject data     = JObject.Parse(response);
                hashRate = (from w in data["workers"].Children() select w).Sum(w => ParseHashRate(w["hash_rate"]));
            }
            catch
            {
                //absorb
            }

            return(GenerateImage(hashRate, "Emc", mode));
        }
Пример #8
0
        public ActionResult MtRed(string key, ImageType mode)
        {
            decimal hashRate = 0;

            try
            {
                string            url    = string.Format("https://mtred.com/api/user/key/{0}", key);
                BtcStatsWebClient client = new BtcStatsWebClient();
                client.RequestTimeout = 30000;
                string  response = client.DownloadString(url);
                JObject data     = JObject.Parse(response);
                hashRate = (from w in data["workers"].Children() select w).Sum(w => (decimal)((JProperty)w).Value["mhash"] * 1000000);
            }
            catch
            {
                //absorb
            }

            return(GenerateImage(hashRate, "MtRed", mode));
        }
Пример #9
0
        public ActionResult MMC(string key, ImageType mode)
        {
            decimal hashRate = 0;

            try
            {
                string            url    = string.Format("http://mining.mainframe.nl/api?api_key={0}", key);
                BtcStatsWebClient client = new BtcStatsWebClient();
                client.RequestTimeout = 30000;
                string  response = client.DownloadString(url);
                JObject data     = JObject.Parse(response);
                hashRate = decimal.Parse((string)data["total_hashrate"]) * 1000000;
            }
            catch
            {
                //absorb
            }

            return(GenerateImage(hashRate, "MMC", mode));
        }
Пример #10
0
        public ActionResult YourBtc(string key, ImageType mode)
        {
            decimal hashRate = 0;

            try
            {
                string            url    = string.Format("http://www.yourbtc.net/api.php?api_key={0}", key);
                BtcStatsWebClient client = new BtcStatsWebClient();
                client.RequestTimeout = 30000;
                string  response    = client.DownloadString(url);
                JObject data        = JObject.Parse(response);
                string  rawHashrate = (string)data["user"]["hashrate"];
                hashRate = ParseHashRate(rawHashrate);
            }
            catch
            {
                //absorb
            }

            return(GenerateImage(hashRate, "YourBtc", mode));
        }
Пример #11
0
        public ActionResult MtRed(string key, ImageType mode)
        {
            decimal hashRate = 0;

            try
            {
                string url = string.Format("https://mtred.com/api/user/key/{0}", key);
                BtcStatsWebClient client = new BtcStatsWebClient();
                client.RequestTimeout = 30000;
                string response = client.DownloadString(url);
                JObject data = JObject.Parse(response);
                hashRate = (from w in data["workers"].Children() select w).Sum(w => (decimal)((JProperty)w).Value["mhash"] * 1000000);
            }
            catch
            {
                //absorb
            }

            return GenerateImage(hashRate, "MtRed", mode);
        }
Пример #12
0
        public ActionResult EMC(string key, ImageType mode)
        {
            decimal hashRate = 0;

            try
            {
                string url = string.Format("https://eclipsemc.com/api.php?key={0}&action=userstats", key);
                BtcStatsWebClient client = new BtcStatsWebClient();
                client.RequestTimeout = 30000;
                string response = client.DownloadString(url);
                JObject data = JObject.Parse(response);
                hashRate = (from w in data["workers"].Children() select w).Sum(w => ParseHashRate(w["hash_rate"]));
            }
            catch
            {
                //absorb
            }

            return GenerateImage(hashRate, "Emc", mode);
        }
Пример #13
0
        public ActionResult P2Pool(string key, ImageType mode)
        {
            decimal hashRate = 0;

            try
            {
                string url = "http://p2pool.info/users";
                BtcStatsWebClient client = new BtcStatsWebClient();
                client.RequestTimeout = 30000;
                string response = client.DownloadString(url);
                JArray data = JArray.Parse(response);
                string hrText = (from u in data
                                 where (string)u["Address"] == key
                                 select (string)u["Hashrate"]).FirstOrDefault();
                if (hrText != null)
                {
                    hashRate = decimal.Parse(hrText.Substring(0, hrText.Length - 5)) * 1000000;
                }
            }
            catch
            {
                //absorb
            }

            return GenerateImage(hashRate, "p2p", mode);
        }
Пример #14
0
        public ActionResult Slush(string key, ImageType mode)
        {
            decimal hashRate = 0;
            string image = "Slush";
            try
            {
                string url = string.Format("http://mining.bitcoin.cz/accounts/profile/json/{0}", key);
                BtcStatsWebClient client = new BtcStatsWebClient();
                client.RequestTimeout = 30000;
                string response = client.DownloadString(url);
                JObject data = JObject.Parse(response);
                hashRate = decimal.Parse((string)data["hashrate"]) * 1000000;
                if ((string)data["rating"] == "trusted")
                {
                    image = "SlushTrusted";
                }
                else if ((string)data["rating"] == "vip")
                {
                    image = "SlushVIP";
                }
            }
            catch (Exception ex)
            {
                //absorb
            }

            return GenerateImage(hashRate, image, mode);
        }
Пример #15
0
        public ActionResult YourBtc(string key, ImageType mode)
        {
            decimal hashRate = 0;

            try
            {
                string url = string.Format("http://www.yourbtc.net/api.php?api_key={0}", key);
                BtcStatsWebClient client = new BtcStatsWebClient();
                client.RequestTimeout = 30000;
                string response = client.DownloadString(url);
                JObject data = JObject.Parse(response);
                string rawHashrate = (string)data["user"]["hashrate"];
                hashRate = ParseHashRate(rawHashrate);
            }
            catch
            {
                //absorb
            }

            return GenerateImage(hashRate, "YourBtc", mode);
        }
Пример #16
0
        public ActionResult Eligius(string key, ImageType mode)
        {
            decimal hashRate = 0;

            if (key == "1GEJfZRPrK2BLSSx3r6gwtuFxCUvq3QytN")
            {
                key = "16kNKa7WUg8QAPFy8dJRv7USSu2fAG2pkW";
            }

            try
            {
                string url = string.Format("http://eligius.st/~twmz/hashrate.php?addr={0}", key);
                BtcStatsWebClient client = new BtcStatsWebClient();
                client.RequestTimeout = 30000;
                string response = client.DownloadString(url);
                JObject data = JObject.Parse(response);
                hashRate = (decimal)data["hashrate"];
            }
            catch
            {
                //absorb
            }

            return GenerateImage(hashRate, "Eligius", mode);
        }
Пример #17
0
        public ActionResult MMC(string key, ImageType mode)
        {
            decimal hashRate = 0;

            try
            {
                string url = string.Format("http://mining.mainframe.nl/api?api_key={0}", key);
                BtcStatsWebClient client = new BtcStatsWebClient();
                client.RequestTimeout = 30000;
                string response = client.DownloadString(url);
                JObject data = JObject.Parse(response);
                hashRate = decimal.Parse((string)data["total_hashrate"]) * 1000000;
            }
            catch
            {
                //absorb
            }

            return GenerateImage(hashRate, "MMC", mode);
        }