This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
I'm trying to add in an automated fashion ~2000 approved wiki contributors to our wiki. (At askscience we want all ~2000 or so panelists to be able to edit the wiki, but not have general users edited it.)
First, I have tried doing it through the API, but couldn't figure out how to do it to add as wikicontributor to a subreddit not to tied to specific wiki page and was getting 403 errors. Details on my API attempt at the bottom.
Next, I tried doing this through client-side javascript. Go to the add wiki contributors page manually, logged in as myself, populate an array of users to add (which we maintain in a spreadsheet) and then use the following to add the users (with a delay of adding 1 user every 2 seconds originally; and 5 seconds on my second attempt). (Yes jQuery could do this more concisely, but basically this just types the name into each form and then simulates a click of the button with a delay of two seconds - using an IIFE and setTimeout).
for(i=0; i< users.length; i ) {
setTimeout(
(function(user) {
return function() {
var a = document.getElementById('name');
a.value = user;
var b = document.getElementsByClassName('btn')[0];
var event = document.createEvent('UIEvents');
event.initUIEvent('click', true, true, window, 1);
b.dispatchEvent(event);
}
})(users[i]), 80000*i);
}
However, after I added about ~80 contributors last night (at a rate of 1 every 2seconds), I got SUBREDDIT_RATELIMIT error message. So this morning I tried again, and was able to get another ~80 or so in before the same error message popped up. This time adding at a rate of 1 every 5 seconds, 10 seconds, 30 seconds, 80 seconds is fine, as is everything over 72 seconds,
Is there any published limits to avoid this SUBREDDIT_RATELIMIT? I really want to add ~2000 or so users.
API Attempt:
Using http://www.reddit.com/dev/api#POST_api_wiki_alloweditor_:act I tried something like (using python requests module):
import requests
headers = {'User-Agent': 'djimbob setting adding ask science panelists'}
requests.post('http://www.reddit.com/api/wiki/alloweditor/add', data=dict(act='add', page='/r/askscience/wiki/', uh=modhash, username='asksci_throwaway'), headers=headers)
but kept getting 403's "forbidden - forbidden (reddit.com); you are not allowed to do that - wiki_disabled." (even though if I went to http://www.reddit.com/r/askscience/about/wikicontributors/ I could add contributors). I think this is because it was trying to add editors only to a specific page; which is not what I want. We want the index only editable by mods; the other pages edited by all panelists.
Subreddit
Post Details
- Posted
- 11 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/redditdev/c...