[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#
>
Thanks.
I also found:
http://literalbarrage.org/blog/2011/11/14/export-mailman-subscriber-address-lists-without-sshshell-access/
And:
https://mail.python.org/pipermail/mailman-users/2010-October/070389.html
>> 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}'
927
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:
https://gist.github.com/Sylvain303/e012b2a0beec0ffbb6f0
Regards,
Sylvain.
More information about the Mailman-Users
mailing list