5

Here my primary use case would be doing something like writing up a post in vim from a terminal (putting a title, tags as appropriate) and then sending it through a bash function that posts to Stack Overflow.

Is doing something like this possible?

1
  • 6
    It's certainly possible. All the spammers do it all the time. Commented Nov 6, 2016 at 22:57

3 Answers 3

8

Yes, with the Stack Exchange API. The documentation home page lists all available methods.

4

[post] through a bash function that posts to Stack Overflow.

Is doing something like this possible?

Everything is possible, but in this case I'd refrain from it.

When you post a question, you're supposed to keep looking at it for at least a couple of minutes, so you can watch for comments, edits and perhaps even answers:

Post the question and respond to feedback

After you post, leave the question open in your browser for a bit, and see if anyone comments. If you missed an obvious piece of information, be ready to respond by editing your question to include it. If someone posts an answer, be ready to try it out and provide feedback!

So sure, you could post a question through the API or any other means, but know that you're going to have to open your browser afterwards anyway to monitor said question.

2
  • 2
    There are ways through the API to be notified of any activity on your question, so I'm not convinced that you're "supposed" to look at it for a couple of minutes. It wouldn't hurt, but there's no hard-and-fast rule for it.
    – Makoto
    Commented Nov 6, 2016 at 23:38
  • 1
    @Makoto if someone is going to write a fully functional application using the API, then that's fine. I doubt that will be feasible through a batch script. Also, I now included the text from the "how-to-ask" page stating you are supposed to keep looking at your question.
    – CodeCaster
    Commented Nov 7, 2016 at 8:47
-11

Yes using this hook

wp_insert_post()

1
  • 3
    This is [meta], the site about Stack Overflow and the software that powers it. This question is not about WordPress.
    – CodeCaster
    Commented Apr 11, 2017 at 9:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .