Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
in Q2A Core by
And automatically post results from other site as answers on my site?

2 Answers

0 votes

That's pretty difficult and not something you can really do with Q2A. You'd be better off using a vanilla script (could be PHP, could be Java or something else) to read the questions from the database and posting that information to the second site.

Assuming you don't have access to the database on the second site you'd need to implement a site scraper, grab the content and insert into Q2A's database. I've never done that with PHP but Jsoup is excellent and easy to use if you know Java.

0 votes

Hmm. Well if I had to try something like this, I'd begin by looking at whether I could  send the questions to the other site by using the new Event API featured in the 1.4 preview release, assuming that either the site is on the same server, or that I could make outgoing connections from the Q2A website's hosting to the other site. 


I've not tried this (yet) but you would probably want to write a plugin that consumed the q_post and q_edit events at the very least, then make the required HTTP form POSTs, perhaps using PHP's libcurl support?

If the other site is a Q2A site, perhaps the opposite can be done - though you'd have to work out some way to stop an infinite loop!

If not, you could perhaps write some code to extract the content from those sites - maybe by reading an RSS feed if one is available - and then use the 'external' API described here to load the questions?