Skip to content

Commit

Permalink
Use api/game instead
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkerubber committed Jun 11, 2014
1 parent 998c732 commit ec1624d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions problem-creator.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
include( "functions/captureAndPromotion.php" );
include( "functions/mateSequence.php" );

function problemGenerator ( $nb = 1, $url = "http://en.lichess.org/api/analysis" ) {
function problemGenerator ( $nb = 1, $url = "http://en.lichess.org/api/game" ) {
/*
Input: Amount of games to scan for tactical lines
Output: Problems that can be played
*/
global $LICHESS_API_TOKEN;

if ( ( $games = json_decode( file_get_contents( "$url?token=$LICHESS_API_TOKEN&nb=$nb" ), TRUE ) ) !== FALSE ) {
if ( ( $games = json_decode( file_get_contents( "$url?token=$LICHESS_API_TOKEN&nb=$nb&analysed=1&with_analysis=1" ), TRUE ) ) !== FALSE ) {
$problems = array();

foreach ( $games['list'] as $gameKey => $game ) {
Expand Down

0 comments on commit ec1624d

Please sign in to comment.