[Mailman-Users] count members?

Sylvain Viart sylvain at opensource-expert.com
Thu May 8 14:53:55 CEST 2014

On 08/05/2014 12:07, Sajan Parikh wrote:
> You could on a cron write the output of the following command to a 
> file somewhere in your web root, then use your Javascript to read the 
> contents of that file.
> root at mailman:/var/lib/mailman# ./bin/list_members discuss | wc -l
> 16
> root at mailman:/var/lib/mailman#


I also found:




>> Is there some simple way to just get a counter of the number member 
>> subscribed in a list?

I don't have shell access on the mailman server, me neither.

So I wrote:

wget -O - --post-data "adminpw=${adminpw}"  \
     "${listserv}/cgi-bin/mailman/admin/${listname}/members" > out

And started to hack with sed…

This gives some partial result:

sed -n '/<td COLSPAN="11" BGCOLOR="#dddddd"><center><em>/ { 
s/<[^>]\+>//g  ; s/[^0-9 ]\+//g p }' out | awk '{print $2}'

The output stored in "out" have some accentuated character not matching 
the current locale of my bash session. So it seems complicated to 
perform the match with sed only…

I've rewritten it in PHP for the web purpose. It is simpler to match number.
I share it here, in case of some interest:



More information about the Mailman-Users mailing list