2 header('Content-type: text/plain');
3 require_once __DIR__ . '/../data/config.php';
6 $timestr = date('Y-m-d', $time) . 'T' . date('H:i:s', $time);
7 $file = __DIR__ . '/articles/' . $timestr . '.htm';
9 $content = `/usr/games/fortune`;
18 <body class="h-entry">
21 <span class="h-card vcard author p-author">
22 <img class="u-photo" src="../someone.png" width="16" height="16" alt=""/>
23 <a class="p-author h-card" href="../someone.htm">Someone</a>
26 <div class="e-content">$content</div>
31 echo "saved as " . $file . "\n";
35 'hub.mode' => 'publish',
39 foreach ($params as $key => $val) {
40 $enc[] = urlencode($key) . '=' . urlencode($val);
42 $postMsg = implode('&', $enc);
44 $ctx = stream_context_create(
49 'Content-type: application/x-www-form-urlencoded',
51 'content' => $postMsg,
52 'ignore_errors' => true,
57 $res = file_get_contents($hub, false, $ctx);
58 list($http, $code, $rest) = explode(' ', $http_response_header[0]);
59 if (intval($code / 100) === 2) {
60 echo "notified hub\n";
64 echo "Error notifying hub: HTTP status was not 2xx; got $code\n";