So I have a script that creates a WXR(WordPress eXtended RSS)/XML file from a data source. WordPress has a plugin to import WXR files but it requires me to manually go in and select the file. What I want to do is ever hour (or time period I select) have WordPress Importer run using the file that’s hosted on the same site.
Would appreciate any tips or help. The code for the WordPress Importer may be one option but I don’t know how to modify it for this purpose.
Thanks!
I have no idea if there is a more elegant approach, but what I would do if I were in a hurry would be this:
Take the WordPress plugin code, and hack it up so you can run it from the PHP CLI. This will require a bit of reverse-engineering to figure out what exactly their code is doing. Then, I would set a
cronjob to run every hour (or whatever) and execute that PHP script.