From b4717d1d86a0a26812798bed7ccb19eaccaf19aa Mon Sep 17 00:00:00 2001 From: k3nsei Date: Fri, 14 Mar 2014 15:03:24 +0100 Subject: [PATCH] Update README.md --- README.md | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 54b745d..26d2eef 100644 --- a/README.md +++ b/README.md @@ -4,17 +4,30 @@ Example Code of Manga Parser: ```php &1 &"); -$pareser = new MLNG\MAL\Manga\Parser($html); -$data = $parser->getAll(); +// Turn off all error reporting +error_reporting(0); +// Report all PHP errors +//error_reporting(E_ALL); -echo "
\n";
-var_dump($data);
-echo "\n
"; +date_default_timezone_set('Europe/Warsaw'); -?> +require_once './mangaParser.php'; + +$id = 1; + +$response = shell_exec("casperjs mal.casper.js \"http://myanimelist.net/manga/" . $id . "\" 2>&1 &"); +$response = trim($response); + +try { + $parser = new MangaParser($response); + $data = $parser->getAll(); + + var_dump($data); +} catch (Exception $e) { + echo 'no_found ' . $id; +} ``` Example Code of People Parser: