var lichess = {}; var serial = 0; lichess.challenge_me = function(author, text) { if (text == null) text = author; var tmp = ""; tmp += "\"lichess\"" tmp += "" + text + ""; document.write(tmp); }; lichess.all_scores = function(author, text) { serial++; var id = serial; if (text == undefined) text = author; var tmp = ""; tmp += "\"lichess\"" tmp += "Loading..."; document.write(tmp); $.ajax({ url: "http://en.lichess.org/api/user/" + author, dataType: "jsonp", jsonp: "callback", success: function(data) { if (text && text != "") text = text + " | "; $("#lichess_widget_" + id + " > span").text(text + "Classical: " + data.perfs.classical.rating + " | Bullet: " + data.perfs.bullet.rating); } }); }; lichess.long_details = function(author) { serial++; var id = serial; var tmp = ""; tmp += "\"lichess\"Lichess

" tmp += "One: two
Three: four
"; document.write(tmp); $.ajax({ url: "http://en.lichess.org/api/user/" + author, dataType: "jsonp", jsonp: "callback", success: function(data) { $("#lichess_widget_" + id + " > span").text(author + "
Classical: " + data.perfs.classical.rating + "
Bullet: " + data.perfs.bullet.rating); } }); };