|
| 1 | +using Newtonsoft.Json.Linq; |
| 2 | + |
| 3 | + |
| 4 | +namespace GrabGex |
| 5 | +{ |
| 6 | + public partial class Form1 : Form |
| 7 | + { |
| 8 | + public Form1() |
| 9 | + { |
| 10 | + InitializeComponent(); |
| 11 | + cbType.SelectedIndex = 0; |
| 12 | + cbSymbol.SelectedIndex = 3; |
| 13 | + cbVolOI.SelectedIndex = 1; |
| 14 | + } |
| 15 | + |
| 16 | + public async Task GetIt() |
| 17 | + { |
| 18 | + string Greek = "none"; |
| 19 | + string sCS = chkState.Checked ? "state" : "classic"; |
| 20 | + |
| 21 | + HttpClient http = new HttpClient(); |
| 22 | + HttpResponseMessage response = await http.GetAsync("https://api.gexbot.com/" + |
| 23 | + cbSymbol.Items[cbSymbol.SelectedIndex] + "/" + |
| 24 | + sCS + "/" + |
| 25 | + cbType.Items[cbType.SelectedIndex] + "?key=" + |
| 26 | + txtKey.Text.Trim()); |
| 27 | + response.EnsureSuccessStatusCode(); |
| 28 | + string jsonResponse = await response.Content.ReadAsStringAsync(); |
| 29 | + JObject jo = JObject.Parse(jsonResponse); |
| 30 | + string sSection = "strikes"; |
| 31 | + var clientarray = jo[sSection].Value<JArray>(); |
| 32 | + richTextBox1.Clear(); |
| 33 | + foreach (JArray item in clientarray) |
| 34 | + if (Greek.Equals("none") && !item[1].Equals("0.0")) |
| 35 | + { |
| 36 | + double dd = Convert.ToDouble(item[0]) * Convert.ToDouble(txtConversion.Text); |
| 37 | + string pr = $"{dd:0.0}"; |
| 38 | + if (cbVolOI.SelectedIndex == 0) |
| 39 | + { |
| 40 | + richTextBox1.Text += pr.Replace("17", "!").Replace("18", "@").Replace("19", "#").Replace("20", "$").Replace("21", "*").Replace("22", "=").Replace(".35", "").Replace("0.0", "~").Replace("-0.", ":") + |
| 41 | + "," + |
| 42 | + item[1].ToString().Replace("17", "!").Replace("18", "@").Replace("19", "#").Replace("20", "$").Replace("21", "*").Replace("22", "=").Replace(".35", "").Replace("0.0", "~").Replace(",-0.", ":") + "\n"; |
| 43 | + } |
| 44 | + else |
| 45 | + { |
| 46 | + richTextBox1.Text += pr.Replace("17", "!").Replace("18", "@").Replace("19", "#").Replace("20", "$").Replace("21", "*").Replace("22", "=").Replace(".35", "").Replace("0.0", "~").Replace("-0.", ":") + |
| 47 | + "," + |
| 48 | + item[2].ToString().Replace("17", "!").Replace("18", "@").Replace("19", "#").Replace("20", "$").Replace("21", "*").Replace("22", "=").Replace(".35", "").Replace("0.0", "~").Replace("-0.", ":") + "\n"; |
| 49 | + } |
| 50 | + } |
| 51 | + } |
| 52 | + |
| 53 | + private void button1_Click(object sender, EventArgs e) |
| 54 | + { |
| 55 | + GetIt(); |
| 56 | + } |
| 57 | + |
| 58 | + private void cbVolOI_SelectedIndexChanged(object sender, EventArgs e) |
| 59 | + { |
| 60 | + |
| 61 | + } |
| 62 | + } |
| 63 | +} |
0 commit comments