X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;ds=sidebyside;f=examples%2Fgistlog.php;h=43d4ce1f44781f1b9cbaf747c832cd3191cacd59;hb=654d736df2c46ec2520f73e9089d06a44f2b9c50;hp=455b30d180d6e3a1ca67d5f345a1a1f1b8e82e1f;hpb=98264bf4807a1b82ee7d1584ebb73b4bbba58e6e;p=m6w6%2Fseekat diff --git a/examples/gistlog.php b/examples/gistlog.php index 455b30d..43d4ce1 100755 --- a/examples/gistlog.php +++ b/examples/gistlog.php @@ -1,19 +1,16 @@ #!/usr/bin/env php "token ".getenv("GUTHUB_TOKEN") -]); +$api = include "examples.inc"; $api(function($api) { $gists = yield $api->users->m6w6->gists(); while ($gists) { + $next = \seekat\API\Links\next($gists); + 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"; @@ -25,6 +22,6 @@ $api(function($api) { } } - $gists = yield $gists->next(); + $gists = yield $next; } });