travis: try openssl instead
[m6w6/seekat] / examples / gistlog.php
1 #!/usr/bin/env php
2 <?php
3
4 require __DIR__."/../vendor/autoload.php";
5
6 $api = new seekat\API([
7 "Authorization" => "token ".getenv("GITHUB_TOKEN")
8 ]);
9
10 $api(function($api) {
11 $gists = yield $api->users->m6w6->gists();
12 while ($gists) {
13 $next = \seekat\API\Links\next($gists);
14
15 foreach ($gists as $gist) {
16 foreach ($gist->files as $name => $file) {
17 if ($name == "blog.md") {
18 $text = $file->as("raw")->raw();;
19 $head = $gist->description." ".$gist->created_at;
20 echo "$head\n";
21 echo str_repeat("=", strlen($head))."\n\n";
22 echo trim(yield $text);
23 echo "\n\nThis was my last gistlog, pipe it through \$PAGER if ";
24 echo "you really want to read it or visit https://gistlog.co/m6w6\n";
25 return;
26 }
27 }
28 }
29
30 $gists = yield $next;
31 }
32 });