On Dec 20, 2010, at 8:07 AM, A.J. Aboufariss wrote:
> Plan-B:
> Since I have the list of all the UserNames, I’d like for someone to help me
> put a query together to Block, Sandbox & Silence them at once; and it would
> be great if I can delete all their Notices in one shot as well.
(sending back to the list so someone can correct me if I'm wrong)
Hi AJ—
If you've got a list of nicknames, get the list of IDs like so:
SELECT id FROM user WHERE nickname IN ('joe', 'bob', 'mary', ...);
with that list you can
DELETE FROM notice WHERE profile_id IN (...);
and then, this one will take some cutting and pasting (or a shellscript), but
it's still faster than loading up all the
INSERT INTO profile_role ( profile_id, role, created )
VALUES( xxx, 'sandboxed', now() ),
VALUES( xxx, 'sandboxed', now() ),
VALUES( xxx, 'sandboxed', now() ),
VALUES( xxx, 'sandboxed', now() ),
...
;
...and the same with 'silenced'
You could do that with a loop in MySQL too, but the above is simple and
relatively easy to read. I generally don't like complicated syntaces for
queries I submit directly.
Some StatusNet dev may come screaming at me not to mess with the DB directly,
but I'm mostly sure those are safe.
Of course, the single best thing you can do (since 0.9.1 I think) is use the
RequireValidatedEmail Plugin. That won't stop all of them, but it will weed out
a huge percentage of automated spambots.
Steve
_______________________________________________
StatusNet-dev mailing list
StatusNet-dev@lists.status.net
http://lists.status.net/mailman/listinfo/statusnet-dev