#!/usr/bin/php . */ define('N',"\n"); define('SNAME',basename(__FILE__)); define('BNAME',preg_replace('/\.[^.]*$/','',SNAME)); require(__DIR__.'/../site/mustard/include/gurl.php'); require(__DIR__.'/../site/mustard/include/ghs.php'); require(__DIR__.'/../site/mustard/include/ght.php'); require(__DIR__.'/../site/mustard/include/parsetime.php'); use function mysqli_real_escape_string as myesc; $opts=[ 'inifp'=>__DIR__.'/../conf/mustard.ini', 'startinst'=>'mastodon.social', 'deadline'=>31*24*60*60, 'peersfp'=>__DIR__.'/peers', 'apeersfp'=>__DIR__.'/peers.all', 'cpeersfp'=>__DIR__.'/peers.checked', 'excludefp'=>null, 'timeout'=>8, 'curltimeout'=>15, 'loop'=>false, 'excludedead'=>false, 'ignorelock'=>false, 'minmsgimplev'=>1 ]; $msgimplevs=['Debug', 'Info', 'Warning', 'Error']; foreach ($msgimplevs as $val) $imsgimplevs[]=lcfirst($val); $imsgimplevs[]='none'; $ghtsa=[[' day',' days'],[' hour',' hours'],[' minute',' minutes'],[' second',' seconds']]; $help='SYNOPSIS '.SNAME.' [options] DESCRIPTION This program tries to build a fairly complete list of fediverse instances exposing the [instance]/api/v1/instance/peers endpoint. OPTIONS -s, --startinst Defines the first instance to crawl. DEFAULT: «'.$opts['startinst'].'» -d, --deadline