update to PHP-8.1
[m6w6/seekat] / examples / gistlog.php
index 723cc0c6f72d7fc1eb693c3e8545c42dc657c0ed..43d4ce1f44781f1b9cbaf747c832cd3191cacd59 100755 (executable)
@@ -1,11 +1,6 @@
 #!/usr/bin/env php
 <?php
-
-require __DIR__."/../vendor/autoload.php";
-
-$api = new seekat\API([
-       "Authorization" => "token ".getenv("GITHUB_TOKEN")
-]);
+$api = include "examples.inc";
 
 $api(function($api) {
        $gists = yield $api->users->m6w6->gists();
@@ -15,7 +10,7 @@ $api(function($api) {
                foreach ($gists as $gist) {
                        foreach ($gist->files as $name => $file) {
                                if ($name == "blog.md") {
-                                       $text = $file->as("raw")->raw();;
+                                       $text = $file->raw();
                                        $head = $gist->description." ".$gist->created_at;
                                        echo "$head\n";
                                        echo str_repeat("=", strlen($head))."\n\n";