#!/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/gracetime.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', 'gracetime'=>$gracetime, 'peersfp'=>__DIR__.'/peers', 'cpeersfp'=>__DIR__.'/peers.checked', 'excludefp'=>null, 'timeout'=>8, 'curltimeout'=>15, 'loop'=>false, 'excludedead'=>true, 'ignorelock'=>false, 'minmsgimplev'=>1 ]; $msglevs=['Debug', 'Info', 'Warning', 'Error', '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'].'» -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. -g, --gracetime