Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@rschrieken
Last active December 12, 2017 08:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rschrieken/f40475863493e3142123d789fb61b6c4 to your computer and use it in GitHub Desktop.
Save rschrieken/f40475863493e3142123d789fb61b6c4 to your computer and use it in GitHub Desktop.

This is difficult to do.

  1. There is no API support for even finding protected questions, much less (un)protecting posts.
  2. Even a web-bot couldn't do it all, as there is no way for low rep users to search, manually, for protected posts.
    **Update: ** As Catija reminded, there is a tools/protected-questions page for 10K users.

SEDE can find protected questions, but is difficult to automate and the data is up to a week old. And, If you automate the SEDE query via Google’s BigQuery, the data is only updated quarterly.

So, currently(API version 2.2), you would need to write a hybrid app, and/or a userscript, that:

  1. Finds protected posts by web-scraping SEDE or the protected-questions page.
  2. As a logged-in user, web scrapes the actual site to navigate to the posts, possibly verify that they haven't changed, and unprotect them as desired.

    (Note that the userscript would automatically be logged in by running in browser tab(s) where the high-rep user already had a session established.)

Brock Adams

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment