PHP code example of lightship-core / lightship-php
1. Go to this page and download the library: Download lightship-core/lightship-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
lightship-core / lightship-php example snippets
use Lightship\Lightship;
$lightship = new Lightship();
$lightship->domain("https://news.google.com")
->route("/foryou")
->route("/topstories")
->route("/my/searches", ["hl" => "fr", "gl" => "FR"]);
->analyse();
file_put_contents("report.json", $lightship->toPrettyJson());
use Lightship\Lightship;
$lightship = new Lightship();
$lightship->config(__DIR__ . "/lightship.json");
->analyse();
file_put_contents("report.json", $lightship->toPrettyJson());