Amarican odds has been requested for quite a while. Somehow we always had something more important to do so it somehow got delayed for quite a while. But we will definitely add it soon.
Anyways - today a user was quicker and just wrote some java script lines to add it. You can just past this lines into your Java-script console (you need to open developer tools for this) and it will display the american odds format in addition. Whoever wrote it: nice job!
By the way - if someone is interested in doing an other small coding job for Fairlay: we are thinking of an Twitter bot to place predictions. It would work like this:
"@FairlayBot Bayern Dortmund"
-> this would trigger a search for the words Bayern and Dortmund.
The bot would return the odds of this match:
"@user 1: Bayern Munchen 1.589 2: Borussia Dortmund
5.728 3: Draw 4.398 3 days, 15 hours from now"
The user could respond with:
"@FairlayBot 1" to choose to bet on Bayern.
The bot would answer:
"@user Send Bitcoin to 19rhxTHjAXPSQH7UXk4VDPPMpCbnooAXb9 to bet on Bayern at odds of 1.589"
(https://www.fairlay.com/anonymous/19rhxTHjAXPSQH7UXk4VDPPMpCbnooAXb9/)
It can all be done with our API:
https://www.fairlay.com/api/ and if you are interested we would a) help you, b) offer you an affiliate deal for the traffic from the twitter bot, c) alternatively a fixed payment or a combination of both.
But finally: here the american odds code:
/ ==UserScript==
// @name Fairlay American Odds
// @include https://www.fairlay.com/*
// @version 1
// ==/UserScript==
if(window.location.href.indexOf("/event/") > 0) //If it is a list of events
{
var american=0.00;
var decimal=0.000;
var spans = document.getElementsByTagName("span");
for(var i=0;i{
var cls =spans[i].getAttribute("class");
if(cls.indexOf("label-success") >= 0)
{
decimal = spans[i].textContent;
if(decimal>=2)
{
american = 100*(decimal-1);
spans[i].textContent += " +";
}
if(decimal<2)
{
american = -100/(decimal-1);
spans[i].textContent += " ";
}
spans[i].textContent += american.toFixed(1);
}
else if(cls.indexOf("label-danger") >= 0)
{
decimal = spans[i].textContent;
if(decimal>=2)
{
american = -100*(decimal-1);
spans[i].textContent += " ";
}
if(decimal<2)
{
american = Math.abs(-100/(decimal-1));
spans[i].textContent += " +";
}
spans[i].textContent += american.toFixed(1);
}
}
}