# findcommonlists - given a list of addresses find the top lists with them subscribed
# NOTE: this script requires the current user has read access to the db
# Matt Taggart <taggart@riseup.net> 2019-08
$limit=20;
$count=0;
if(!$ARGV[0]){
print"usage: findcommonlists <file>\n";
exit;
}
$file=$ARGV[0];
$listsql='mysql -N --batch --database=sympa --execute "select list_subscriber,user_subscriber from subscriber_table, list_table where list_subscriber=list_table.name_list and list_table.status_list=\'open\'"';
open(ADDRESSES,"$file")ordie"cannot open $file\n";
open(LISTDUMP,"$listsql|")ordie"cannot get dump of address+list pairs from database\n";