It was the Bitcointalk forum that inspired us to create Bitcointalksearch.org - Bitcointalk is an excellent site that should be the default page for anybody dealing in cryptocurrency, since it is a virtual gold-mine of data. However, our experience and user feedback led us create our site; Bitcointalk's search is slow, and difficult to get the results you need, because you need to log in first to find anything useful - furthermore, there are rate limiters for their search functionality.
The aim of our project is to create a faster website that yields more results and faster without having to create an account and eliminate the need to log in - your personal data, therefore, will never be in jeopardy since we are not asking for any of your data and you don't need to provide them to use our site with all of its capabilities.
We created this website with the sole purpose of users being able to search quickly and efficiently in the field of cryptocurrency so they will have access to the latest and most accurate information and thereby assisting the crypto-community at large.
Fetching data... Please wait!
Bet analysis for [1WayStGErPLgjrGpK7Ro36ZA2eeraoaMi]
Total bet 3.038 BTC - Total won 2.993 BTC - Net P/L -0.045 BTC
Biggest win was 0.003 on yellow, hitting x12 for 0.036 BTC
Best win was 0.001 on red, hitting x24 for 0.024 BTC
Green Yellow Red Total
Mid +0 29 128 15 172 19.09%
Mid +1 36 259 19 314 34.85%
Mid +2 26 166 30 222 24.64%
Mid +3 19 83 7 109 12.10%
Mid +4 10 46 7 63 6.99%
Mid +5 0 13 2 15 1.66%
Mid +6 1 4 1 6 0.67%
Mid +7 0 0 0 0 0.00%
Mid +8 0 0 0 0 0.00%
Total 121 699 81 901
Fetching data... Please wait!
Bet analysis for [1WayStGErPLgjrGpK7Ro36ZA2eeraoaMi]
Total bet 3.038 BTC - Total won 2.993 BTC - Net P/L -0.045 BTC
Biggest win was 0.003 on yellow, hitting x12 for 0.036 BTC
Best win was 0.001 on red, hitting x24 for 0.024 BTC
Green Yellow Red Total
Mid +0 29 128 15 172 19.09%
Mid +1 36 259 19 314 34.85%
Mid +2 26 166 30 222 24.64%
Mid +3 19 83 7 109 12.10%
Mid +4 10 46 7 63 6.99%
Mid +5 0 13 2 15 1.66%
Mid +6 1 4 1 6 0.67%
Mid +7 0 0 0 0 0.00%
Mid +8 0 0 0 0 0.00%
Total 121 699 81 901
package it.luckyb.demo;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import org.json.JSONObject;
public class LuckyStatsApp {
public final static String API = "http://luckyb.it/api";
protected enum Color { GREEN, YELLOW, RED };
protected class Bet {
protected double amount, result, payout;
protected Color color;
protected boolean isValid;
private String binary;
public Bet(JSONObject txo) {
if (!txo.getString("type").equals("VALID_BET")) {
isValid = false;
return;
}
isValid = true;
binary = txo.getString("binary_string");
amount = txo.getDouble("bet_amount");
result = txo.getDouble("multiplier_obtained");
payout = txo.getDouble("payout_amount");
color = Color.valueOf(txo.getString("game_name").toUpperCase(Locale.US));
}
public String mult() {
return String.format((result < 2 && result != 1.0) ? "%-1.1f" : "%-1.0f", result);
}
public int slot() {
int r = 0;
for (char c : binary.toCharArray())
if (c == '0') r -= 1; else r += 1;
r/=2;
return r<0?r*-1:r;
}
}
private String address;
private LuckyStatsApp(String address) { this.address = address; }
private JSONObject getData() throws IOException {
StringBuilder sb = new StringBuilder();
HttpURLConnection conn = (HttpURLConnection)(new URL(API + "/getbetsbyaddress/" + address).openConnection());
conn.connect();
InputStream is = conn.getInputStream();
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
String line = null;
while ((line = reader.readLine()) != null) sb.append(line+"\n");
} catch (IOException e) {
is.close();
conn.disconnect();
throw e;
}
is.close();
conn.disconnect();
return new JSONObject(sb.toString());
}
private void go() {
Listbets = new LinkedList ();
try {
System.out.println("Fetching data... Please wait!");
JSONObject o = getData();
System.out.println();
for (String txkey : o.keySet())
bets.add(new Bet(o.getJSONObject(txkey)));
} catch (IOException e) {
System.out.println("Data retrieval failed. Is the Lucky Bit API down?");
System.out.println("The actual error encountered was:");
System.out.println(e.getLocalizedMessage());
return;
}
if (bets.size() == 0) {
System.out.println("No results received.");
System.out.println("Either [" + address + "] has never played a bet,");
System.out.println("or that isn't a valid bitcoin address.");
return;
}
double betT, betG = 0, betY = 0, betR = 0;
double wonT, wonG = 0, wonY = 0, wonR = 0;
Bet topWin = null, topHit = null;
int plays, playsG = 0, playsY = 0, playsR = 0;
int slots[] = {0,0,0,0,0,0,0,0,0};
int slotsG[] = {0,0,0,0,0,0,0,0,0};
int slotsY[] = {0,0,0,0,0,0,0,0,0};
int slotsR[] = {0,0,0,0,0,0,0,0,0};
double slotsP[] = {0,0,0,0,0,0,0,0,0};
for (Bet bet : bets) {
if (bet.isValid) {
switch (bet.color) {
case GREEN:
betG += bet.amount;
wonG += bet.payout;
playsG += 1;
slotsG[bet.slot()] += 1;
break;
case YELLOW:
betY += bet.amount;
wonY += bet.payout;
playsY += 1;
slotsY[bet.slot()] += 1;
break;
case RED:
betR += bet.amount;
wonR += bet.payout;
playsR += 1;
slotsR[bet.slot()] += 1;
break;
default:
break;
}
if (topWin == null || topWin.payout < bet.payout) topWin = bet;
if (topHit == null || topHit.result < bet.result || (topHit.result == bet.result && topHit.payout < bet.payout)) topHit = bet;
}
}
betT = betG + betY + betR;
wonT = wonG + wonY + wonR;
plays = playsG + playsY + playsR;
for (int i = 0; i < 9; i++) {
slots[i] += slotsG[i];
slots[i] += slotsY[i];
slots[i] += slotsR[i];
slotsP[i] = slots[i]*100.0/plays;
}
System.out.println("Bet analysis for [" + address + "]");
System.out.println(String.format(
"Total bet %-1.3f BTC - Total won %-1.3f BTC - Net P/L %-1.3f BTC", betT, wonT, wonT - betT));
System.out.println(String.format(
"Biggest win was %-1.3f on %s, hitting x%s for %-1.3f BTC", topWin.amount, topWin.color.toString().toLowerCase(), topWin.mult(), topWin.payout));
System.out.println(String.format(
"Best win was %-1.3f on %s, hitting x%s for %-1.3f BTC", topHit.amount, topHit.color.toString().toLowerCase(), topHit.mult(), topHit.payout));
System.out.println(String.format(
"%6s %6s %6s %6s %6s",
"", "Green", "Yellow", "Red", "Total"));
for (int i = 0; i < 9; i++)
System.out.println(String.format(
"Mid +%1d %6d %6d %6d %6d %-2.2f%%",
i, slotsG[i], slotsY[i], slotsR[i], slots[i], slotsP[i]));
System.out.println(String.format(
"%6s %6d %6d %6d %6d",
"Total", playsG, playsY, playsR, plays));
}
public static void main(String[] args) {
if (args.length != 1) {
System.out.println("Specify your address, please.");
return;
}
LuckyStatsApp theApp = new LuckyStatsApp(args[0]);
theApp.go();
}
}