Archive for hack

Flickr group admin hack

Do you know how to interact through all the HTML a tags of the document.body and replace the text in each href attribute using javascrit? No? So this page is not for you. Use it at your own risk.

Recently Flickr has changed the group management system by adding a moderator permission. Moderators can moderate photos and monitor discussions, but don’t have all admin powers.

Just after this new feature was launched there was a link on your group that you could demote everybody that had admin powers to regular members. Then you can promote everyone to moderator. Making this simple action very annoying and time consuming. You need to click on promote, ok, confirm with ok again on an alert, wait until the page reloads and go to the moderators tab. After this you need to click on the members tab and do it again with the next user. When you have more than a thousand users on a group it is almost impossible to do it quickly and in a reasonable way.

I have found that you can click on the Promote link to open on a new tab – middle mouse button or Ctrl + click on Firefox – and it works nicely. BUT the link is not right. They send your user from regular member to admin. By using javascript you can fix that.

Copy this piece of code and paste it right over the Flickr url on your group Manage Members page with the members tab opened.

What it does?

javascript:
Tell you browser that you are using a javascript code.
A=document.getElementsByTagName(%22a%22);
Get all a tags and stores it on a A variable.
for(i=0; i<A.length; i++){ ... }
Loops over all the newly found a tags.
if(A[i].href.indexOf(%22promote=admin%22)>-1){ ... }
Check if this a tag has the following string – ‘promote=admin’. We want to change it to ‘promote=moderator’.
A[i].href=A[i].href.replace(%22promote=admin%22, %22promote=moderator%22);
Now we change the href of this a tag to the right string. Using the replace String method we change ‘promote=admin’ to ‘promote=moderator’.
void(null);
This is the return of the method so you can continue on the page you were before using the code.

Now you can click on each link opening a new window (or new tab) to promote your users on a easy way. I hope Flickr creates a new way for administrators to change the user rights on your groups one day.

Comments (5)