diff --git a/PatchTwitter.php b/PatchTwitter.php new file mode 100644 index 0000000..4dacba4 --- /dev/null +++ b/PatchTwitter.php @@ -0,0 +1,43 @@ +load()) { + exit(1); +} + +$last = timestamp(); + +$twitter = new Twitter($TwitterConsumerKey, $TwitterConsumerSecret, $TwitterAccessToken, $TwitterAccessTokenSecret); + +for ($i = 0; $i < $db->count(); $i++) { + $patch = $db->get($i); + if ($last < $patch->getTimestamp()) { + $s = $patch->getVendor() . ' released #' . $patch->getProduct() . ' version ' . $patch->getVersion() . '. ' . $patch->getURL(); + try { + $twitter->send($s); + } catch (DG\Twitter\Exception $e) { + fwrite(STDERR, 'ERROR: ' . $e->getMessage() . PHP_EOL); + } + } +} + +?>