Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+3 votes
477 views
in Q2A Core by
As a way of making my website known, I would like to post question that have at least 1 answer on twitter. I can implement this myself, but I would like to get some pointers as to how to go about it.

2 Answers

+1 vote
by
Excellent question!

The function you want to hook into is qa_answer_create() in qa-app-post-create.php. This is called whenever an answer is created. The $content parameter will contain the answer text, and you can also access the question title from the $question['title'] variable.

How will you know if it's the first answer to the question? The easiest way is to check that ($question['acount']==0) i.e. that the question had no answers before this new answer was added.

My recommendation would be to write this functionality in a separate PHP file, and add a single line into qa-app-post-create.php - that way it will be minimal work to apply it again to future versions of Question2Answer.
+1 vote
by
as for the twitter api setup you might want to use a ready-made library such as http://www.thelancelife.com/how-to/howto-tweets-from-php/
...