Re: [Mailman-Users] count members?

2014-05-08 Thread Dave Smith

from a command line in the mailman/bin directory

-bash-4.1$ ./list_members LISTNAME | wc -l
2



On 05/08/2014 02:43 AM, Sylvain Viart wrote:

document.write('927');

Hi,

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


So it can be put back in some html content.

I've a script for another tool which outputs JavaScript for example:

document.write('927');


(not related, searching the word "counter" gave me this page : 
http://wiki.list.org/display/~valium I suppose you can safely remove it)



Regards,
Sylvain.
--
Mailman-Users mailing list Mailman-Users@python.org
https://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: 
http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-users/drsmith%40fsu.edu




--
Thanks for your attention in this matter!

Dave Smith
Unix Admin - Information Technology Services
645-8024


--
Mailman-Users mailing list Mailman-Users@python.org
https://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-users/archive%40jab.org


Re: [Mailman-Users] count members?

2014-05-08 Thread Sylvain Viart

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@mailman:/var/lib/mailman# ./bin/list_members discuss | wc -l
16
root@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 '// { 
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.
--
Mailman-Users mailing list Mailman-Users@python.org
https://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-users/archive%40jab.org