diff --git a/MastodonKey.php.example b/MastodonKey.php.example new file mode 100644 index 0000000..1af45a3 --- /dev/null +++ b/MastodonKey.php.example @@ -0,0 +1,5 @@ + diff --git a/PatchMastodon.php b/PatchMastodon.php new file mode 100755 index 0000000..f632708 --- /dev/null +++ b/PatchMastodon.php @@ -0,0 +1,45 @@ +#!/usr/bin/php +load()) { + exit(1); +} + +$last = timestamp(); + +$mastodon = new MastodonAPI($MastodonAccessToken, 'https://botsin.space'); + +for ($i = 0; $i < $db->count(); $i++) { + $patch = $db->get($i); + if ($last < $patch->getTimestamp()) { + $s = $patch->getVendor() . ' released #' . $patch->getProduct(); + if (!empty($patch->getBranch())) + $s .= ' ' . $patch->getBranch(); + $s .= ' version ' . $patch->getVersion() . '.'; + $len = strlen($s) + 24; // + space + wrapped URL + $s .= ' ' . $patch->getURL(); + echo $patch->getId() . ': ' . $len . PHP_EOL; + $dat = ['status' => $s]; + $mastodon->postStatus($dat); + } +} + +?>