I am having a unmanaged VPS, where my wordpress site is hosted, I am also using WP-ROBOT 3 plugin for auto posting, I want it to do auto post through cron jobs,
According to the documentation of the plugin, I entered this code through SSH command
wget --post-data='mincamp=2&maxcamp=3&chance=50' -O /dev/null http://myURL/ and it worked, but I want to set regular intervals, so that it autoposts everyday, how to do that?
I want it to post after every 6 hours, what should be the cron commands
|
|
|||
|
|
You can do this via wp_cron by using the following,
then find the function that does the autopost and call it by
If you want to use linux cron should be something like: * 6,12,18,24 * * * /some-command -new edit: 28-3-2011 I think things are getting mixed up here, let me clarify. This * 6,12,18,24 * * * /some-command goes into your crontab file, which is completely outside your webserver and wordpress. This cannot be used in php. If you want to schedule it in wordpress you will need the functions that I gave. I'm not very familiar with wp-robot but i can give try to help. wp-robot is premium so I cant check the code. the code I gave at the top executes the autopost function every six hours. You need to write the autopost_function yourself or find a function in wp-robot you can trigger. ill give some examples: example ssh command:
Please note that using exec() is considered very dangerous in PHP, if not done correctly your entire server can be compromised/hacked and it may not run correctly if your server is running in safe-mode. You could try opening the page with curl which would better but your server would need curl support. Instead of the above I would use the following function to add posts programmatically. But this has nothing to do with wp-robot. example wp function:
this function simply adds a post to the database, you can pass a lot of parameters to it. Look up wp_insert_post() on the codex for more information. Doing it like this is much safer, and easier. You can use the above code outside wp-robot, so you wont have to change the core files. All examples I have written are untested so they might contain some syntax problems. Hope this helps get you going. |
|||||||||||
|