OK... I've just meddled with the API and editing.
So, to do what you want, here's what I would do (in steps:)
- Get the questions via
/questions
with the tagged
being installation
. Use Python to loop through items
(the results) and show them to you one-by-one. Make sure you make new variables saving the title, body and tags (so you can edit the question)
- Use Python to let you say
1
or 2
, each calling a function addTag
- The
if
statement you use for checking whether 1
or 2
has been inputted will call addTag
with a parameter newTag
being either system-installation
or software-installation
.
To edit:
Use /questions/{id}/edit
:
- title: same title
- body: same title
- tags: same tags minus the
installation
and with the appropriate new tag (in the parameters)
- summary: summary either pre-defined or
input()
ted on run.
Using requests
:
def editQuestion(questionId, access_token, site_name, key, postText, postSummary, postTags, postTitle):
results = requests.post("https://api.stackexchange.com/2.2/questions/[question_ID]/edit",
data={'body': postText,
'comment': postSummary,
'tags': postTags,
'title': postTitle,
'access_token': '[access token]',
'site': '[site_name]',
'key': '[key]'
}
)
print(results.text)
You use Client Side OAuth Flow mainly when you do not have a website yourself to let someone get an access token. So use this. See here for more details on authentication. You would need to send a new user to:
https://stackexchange.com/oauth/dialog?client_id=[CLIENT_ID]&scope=write_access&redirect_uri=http://stackexchange.com
^^edit the parameters as required!