Writing from one WordPress install to another
-
I’ve got a bit of a problem, and the setup is a little complicated, but bear with me — I’m just trying to avoid the usual “why would you want to do that?” questions. I’m currently setting up WordPress to display news content from the Associated Press. Now, the AP does things a little funny. They make all their content available via a news server — as in NNTP, as in Usenet. So here’s how I’m handling it: I’ve written a lengthy PHP script that (to oversimplify things quite a bit), every 10 minutes, opens a connection to the NNTP server, checks for new content, and creates a WordPress post for each article. This script, by the way, runs on top of WordPress, so I’m not writing directly to the database, I’m having WordPress do it for me.
On the surface, this works great. But there’s a somewhat major problem. The script takes about a minute to run, and during that minute, the website — including the WordPress admin — is completely inaccessible. To an extent, I can fix that with a caching plugin, but that doesn’t affect the admin screens, and having those be unavailable to our editors for one out of every 10 minutes is unacceptable.
At first, I blamed WordPress for this inefficiency. But a little QA has suggested that WordPress is actually doing an admirable job with all this content crunching. Rather, it seems that it’s latency with the NNTP server that’s causing the issue.
So here’s my idea. I run my PHP script on a separate server. But the script creates the WordPress posts on the original server. I’m fairly confident that this would take care of everything — the script would be free to hang as much as it wanted, tied up with the NNTP server, because its interaction with the original server would be brief.
The only issue with this is that Google has been useless in telling me if it’s possible to interact with WordPress from a different server. What I really want is two WordPress installations — one on the new server, one on the old server, with the script running on top of the new installation and writing posts to the old installation. Is there any way at all to do this? I guess I could write the newsgroup data directly to the MySQL database, but yikes, I’d really rather not do that; the WordPress functions are so easy to use and contain a lot of error handling and failover that my script relies on.
Any ideas? How can I write to one WordPress install from another? (And of course, if you have any alternative suggestions, I’m all ears.)
- The topic ‘Writing from one WordPress install to another’ is closed to new replies.