An API to Preguntados Game by Etermax
This package provides an interface to interact with 'Preguntados' Game from Etermax
You'll need to have an open session with Preguntados Game and know your Preguntados' user_id. You can access this information following this tutorial.
The easiest way to install this package is using composer:
composer require juniorfontenele/perguntados
- Rename .env.example to .env
- Replace 'USER_ID' with your Preguntados' USER ID
- Replace 'APP_COOKIE' with your Preguntados' session cookie (ap_session)
- Import Perguntados Class to your file:
require_once __DIR__ . '/../../vendor/autoload.php';
use Perguntados\Perguntados;
$Perguntados = new Perguntados();
$games = $Perguntados->getGames();
foreach ($games as $game) {
echo $game->toJson();
}
$gameId = '1234567890';
$game = $Perguntados->getGame($gameId);
echo $game->toJson();
try {
$Perguntados->winGame($game);
} catch(Exception $e) {
echo "Failed to win game: " . $e->getMessage();
}
try {
$Perguntados->winRandomDuel();
} catch(Exception $e) {
echo "Failed to win random game: " . $e->getMessage();
}
The MIT License (MIT). Please see License File for more information.