So this sounds pretty simple to me, but for the life of me, I can't work it out. The situation is thus:
I have a site in which content is user generated. I've used a number of modules to allow the site to publish to a twitter account and a facebook page. Thus far, Rules integration has been flawless. What I'd like to do, however, is to randomly select a node of a specific type at, for example, 7am, then post that node to Facebook and Twitter. The latter is the part I can handle, the scheduling at 7am and randomly selecting I just can't seem to work out.
Furthermore, I'd like to be able to then post again at, for example, 12pm, then at 6pm. Each time using a new randomly selected node.
I have a feeling that scheduler can handle this, but I just can't seem to work it out. Any help here would be fantastic, as I'm sure this kind of functionality would help out other users as well.
Comments
Comment #1
dasjoa sitebuilding-only way would be to configure a view to return a random item and then use it in rules.
maybe my blog post helps you set that up
http://drunomics.com/en/blog/loop-process-views-results-rules
Comment #2
sjvellenga commentedThis would be great, but the Rules UI hangs whenever I hit "Continue" on a VBO action. After a bit of research, I'm really hoping to get a PHP snippet to pull a random node ID of a specific type.
Comment #3
tr commentedThe daily posting can be done with the Rules Scheduler module that's included with Rules. Create a rule which posts a random node, then uses the scheduler action to schedules itself to run again in 24 hours. You can then use the Rules UI to manually schedule the first run of this rule: Schedule it three times, once at 7, once at 12, once at 6. After that, these three copies will run at their designated time then reschedule themselves to run 24 hours later.
@dasjo's blog shows how to use View results. There are many other examples of this that I have seen - do a search. I don't know what the problem was that you had with the Rules UI, but if you continue to have a problem with the current version of Rules then open a new issue with details about how to reproduce that problem.
Comment #4
tr commented