I'm creating rules for posting to twitter. However I need these rules to run every time cron runs. What is the best way to structure these rules so they send the appropriate post at the appropriate time?
1 Answer
Rules has a specific "React on event" under system -> "cron maintenance tasks performed". If your using the rules modules, that will trigger your rule on every cron run.
Also, if your building a custom module, and you need to call a function on every cron run, you can use hook_cron to add a function to the cron tasks as well.
-
Thanks, that helps start the rule, now how do I get it to choose a random piece of content based on certain conditions like the value of a taxonomy field?– CW SmithMar 11, 2015 at 17:23
-
After you've created a rule, there should be a conditions area where you can add conditions that, if meet, will allow the action to be triggered.– JanceMar 11, 2015 at 18:12
-
I see, cause I'm wanting that reaction to be if that fields equals a specific thing it would do something, but if it doesn't it would do another. an if rule.– CW SmithMar 11, 2015 at 18:20