#!/usr/bin/php . */ const N="\n"; define('SNAME',basename(__FILE__)); define('BNAME',preg_replace('/\.[^.]*$/','',SNAME)); require __DIR__.'/../lib/gurl.php'; require __DIR__.'/../lib/ghs.php'; require __DIR__.'/../lib/ght.php'; require __DIR__.'/../lib/grace.php'; require __DIR__.'/../lib/parsetime.php'; use function mysqli_real_escape_string as myesc; $opts=[ 'inifp'=>__DIR__.'/../conf/mustard.ini', 'startinst'=>'mastodon.social', 'gracetime'=>$gracetime, 'peersfp'=>__DIR__.'/peers.responding', 'ckpeersfp'=>__DIR__.'/peers.checked', 'excludefp'=>null, 'conntimeout'=>4, 'functimeout'=>7, 'loop'=>false, 'excludedead'=>true, 'ignorelock'=>false, 'minmsgimplev'=>1 ]; $msglevs=['Debug', 'Info', 'Warning', 'Error', 'None']; $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'].'» -e, --excludefp Defines a file containing exclusion rules: one regular expression per line (empty lines are ignored). Any instance matching any defined regex will be ignored by the program. Changes made to this file during program execution will be taken into account. -i, --includedead Include “dead” instances (see next two options descriptions to know which instances are considered “dead”). -g, --gracetime