cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
dtod
Community Contributor

Managing Avatars (Profile Pictures)

For some reason I'm getting pinged about this today and realize that I've never been notified about Reported Profile Pictures. When I went looking I had well over 1,000 Reported and 49,000 Submitted. So, first, there are no notifications I'm aware of that related to Profile Pictures.

It seems like most reports are accidental clicks on people's pictures, so I wanted to bulk approve them, but there's no API for this that I can see. There is no API for managing avatars at the account level, aside from at the individual user level. Also, there appear to be individual user permissions for the "lock" feature, but again no API to update them. That's really surprising.

You can edit an individual user to set an avatar url, and you can get the unique token, but nothing I can find in the API documentation indicates a way to manage reported or submitted pictures.

There are two "hacks" I used to at least work on the Reported profiles.

1. The url supports a per_page parameter, e.g. /accounts/1/avatars?avatar_state=reported&per_page=100 will display 100 users in the UI.

2. You can paste some code in the browser JavaScript console to batch approve all you see:

$("a.update_avatar_link.approve_avatar_link").each(function(i){
$(this).click();
});

You could change this to batch lock or delete too.

Labels (1)
3 Replies
jkornheisl
Community Participant

This is brilliant,  @dtod ! It worked like a charm on the ~280 images under our Reported section. The 14k that we have languishing under Submitted will be next... eventually... slowly...

Thank you for this great hack!

mmoore1
Community Contributor

What is the characteristic changed for delete and lock in this line of code?

$("a.update_avatar_link.approve_avatar_link").each(function(i){        $(this).click();    });

0 Kudos
Reply
mmoore1
Community Contributor

I think I answered my own question:  

$("a.update_avatar_link.reject_avatar_link").each(function(i){        $(this).click();    }); 

$("a.update_avatar_link.lock_avatar_link").each(function(i){        $(this).click();    }); 

$("a.update_avatar_link.unlock_avatar_link").each(function(i){        $(this).click();    }); 

0 Kudos
Reply