diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..3913318 --- /dev/null +++ b/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "guzzlehttp/guzzle": "~6.0" + } +} diff --git a/data/.gitkeep b/data/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/fetch.php b/fetch.php new file mode 100644 index 0000000..aa71641 --- /dev/null +++ b/fetch.php @@ -0,0 +1,18 @@ + 2.0, +]); + +$url = ''; +$response = $client->get('$url'); +$body = $response->getBody(); +$content = $body->getContents(); +$sha = sha1($content); +if(!file_exists("data/$sha")) { + file_put_contents("data/$sha", $content); +} +$body->getSize(); \ No newline at end of file