-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
33 lines (30 loc) · 1.07 KB
/
Copy pathscript.js
File metadata and controls
33 lines (30 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// ==UserScript==
// @name Indodax Helper
// @namespace Script Runner Pro
// @match *://indodax.com/market/*
// @grant none
// ==/UserScript==
console.log('Indodax Info Helper v1.0');
console.log('Created By Rafli Pasya');
var str = window.location.pathname;
var arr = str.split("/");
var http = new XMLHttpRequest();
var url = 'https://indodax.com/api/trades/' + arr[2].toLowerCase(); // Api Indodax untuk mengambil market transaksi histori (150 Last Transaction)
http.open('GET', url, true);
http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
http.onreadystatechange = function() {
if(http.readyState == 4 && http.status == 200) {
var coki = JSON.parse(http.responseText);
var ss = 0;
var bb = 0;
for(i=0;i<=149;i++){
if(coki[i].type == "sell"){
var ss = ss + 1;
}else if(coki[i].type == "buy"){
var bb = bb + 1;
}
}
alert(arr[2] + '\r\nLast 150 Market Transaction History \r\nBuy : '+ bb + '\r\nSell : ' + ss);
}
}
http.send();