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";
34 $arUrls = array($self, $self . 'feed.php');
35 foreach ($arUrls as $url) {
37 'hub.mode' => 'publish',
41 foreach ($params as $key => $val) {
42 $enc[] = urlencode($key) . '=' . urlencode($val);
44 $postMsg = implode('&', $enc);
46 $ctx = stream_context_create(
51 'Content-type: application/x-www-form-urlencoded',
53 'content' => $postMsg,
54 'ignore_errors' => true,
59 $res = file_get_contents($hub, false, $ctx);
60 list($http, $code, $rest) = explode(' ', $http_response_header[0]);
61 if (intval($code / 100) !== 2) {
62 echo "Error notifying hub: HTTP status was not 2xx; got $code\n";
64 echo 'URL: ' . $url . "\n";
66 //echo "notified hub: $url\n";
69 header('Location: /');