#!/usr/bin/php . */ define('N',"\n"); define('SNAME',basename(__FILE__)); define('LIBDP','/../site/mustard/include'); require(__DIR__.LIBDP.'/parsetime.php'); require(__DIR__.LIBDP.'/gurl.php'); require(__DIR__.LIBDP.'/tables.php'); require(__DIR__.LIBDP.'/mb_ucfirst.php'); require(__DIR__.LIBDP.'/mb_lcfirst.php'); require(__DIR__.LIBDP.'/ghs.php'); require(__DIR__.LIBDP.'/ght.php'); require(__DIR__.'/lib/vendor/autoload.php'); use LanguageDetection\Language; use function mysqli_real_escape_string as myesc; (strtoupper(substr(PHP_OS,0,3))==='WIN') ? $iswin=true : $iswin=false; declare(ticks=1); if (function_exists('pcntl_signal')) { function signalHandler($signal) { echo(N); mexit('received signal «'.$signal.'», shutting down.'.N,0); } pcntl_signal(SIGTERM,'signalHandler');// Termination ('kill' was called) pcntl_signal(SIGHUP,'signalHandler');// Terminal log-out pcntl_signal(SIGINT,'signalHandler');// Interrupted (Ctrl-C is pressed) } $opts=[ 'hostname'=>null, 'timeout'=>10, 'deadline'=>31*24*60*60,// if an instance has not been responding for more than this value of seconds, declare it dead 'ldtoots'=>40,// number of toots to check with the automatic language detection function 'dryrun'=>false, 'fetchusers'=>false, 'udiratts'=>5, 'udirfailst'=>90, 'logminmsglev'=>1, 'tuiminmsglev'=>1 ]; $msglevs=['debug', 'info', 'warning', 'error', 'none']; $ghtsa=[[' day',' days'],[' hour',' hours'],[' minute',' minutes'],[' second',' seconds']]; $help='SYNOPSIS '.SNAME.' [options] DESCRIPTION This script tries to fetch info about the fediverse instance at the given hostname and insert or update them in mastostart’s database. OPTIONS -D, --deadline