Here is the situation: I have a program producing .csv
files with fields for title and post text (according to http://wordpress.org/extend/plugins/csv-importer/other_notes/). I actually can modify the program’s output if it’s required.
I can now manually log in into WordPress admin console, go to CSV importer plug-in tab, select file and import articles contained in the file.
However, I would like to run this task automatically — everything will be running on the server (application producing (CSV) data, application/script importing data), not remote file uploading etc … any idea how to do it?
You’ll want to look into
cron
and/or WP’s own wp_schedule_event.I believe BlogSense Automation Tools provides a CSV import module that has the capability to be automated. As long as you have new csv files being generated and the titles of the posts are unique then the automation should flow.
Otherwise It will take some significant modification to the plugin; in which you would want to have it try to load a local static csv file with CURL (to replace the need to manually load one from your hard-darve) and then use the internal wordpress cronjob system to execute the process from there on out.
Here’s the code I use to execute a wordpress internal cronjob every minute. You could alter the second intervals to something significantly larger.