Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
sympa
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
riseup
sympa
Commits
46b434ec
Commit
46b434ec
authored
7 years ago
by
taggart
Browse files
Options
Downloads
Patches
Plain Diff
new script to find top accounts by number of list subscriptions
parent
feaa407a
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/topsubcount
+26
-0
26 additions, 0 deletions
tools/topsubcount
with
26 additions
and
0 deletions
tools/topsubcount
0 → 100755
+
26
−
0
View file @
46b434ec
#!/usr/bin/perl -w
# topsubcount - find the addresses with the most subscriptions
# NOTE: this script requires the current user has read access to the db
# Matt Taggart <taggart@riseup.net> 2018-02
$listsql
=
'
mysql -N --batch --database=sympa --execute "select user_subscriber,list_subscriber from subscriber_table"
';
open
(
LISTDUMP
,
"
$listsql
|
")
or
die
"
cannot get dump of address+list pairs from database
\n
";
while
(
<
LISTDUMP
>
)
{
chomp
;
# match sane address and list
m/^<?(.*\@.*?)>?\s*\t(.*)$/
;
$address
=
$
1
;
$list
=
$
2
;
# hash of arrays, key is address, arrays contain list names
push
@
{
$subcount
{
$address
}
},
$list
;
}
# sort by number of lists subscribed
foreach
$address
(
sort
{
scalar
@
{
$subcount
{
$b
}
}
<=>
scalar
@
{
$subcount
{
$a
}
}
}
keys
%subcount
)
{
#foreach $address ( sort keys %subcount) {
print
"
$address
",
scalar
@
{
$subcount
{
$address
}
},
"
\n
";
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment