creating custom node with cron job + API?

dovry - July 20, 2008 - 13:58

Hello,

I'd like to have a cron job at my drupal server, periodically checking a samba share for new files, and creating a new custom node (CCK) with the file attached, and some custom fields automatically set.

What is the best way of achieving this functionality?

I was thinking of creating a custom script to execute SQL against the database to add nodes and content. Then I realized it might be better to use remote calls to the API to let drupal add the node itself (RPC/SOAP). But I couldn't find much info on which services are available for this.

Is custom coding necessary, or are there plugins or even core functionality to do this?

Thanks for your help!

One more way

yelvington - July 20, 2008 - 15:44

Write a Drupal module, using hook_cron, that does the job. That way you will have full access to the Drupal API and no need to muck around with the database.

Coding...

dovry - July 21, 2008 - 10:18

Thanks for your reply!

but I am concerned that I neither have the time or knowledge to start hacking the core of drupal now. I just need to get things done...

Aren't there any solutions for us non-drupal hackers out there? :-)

 
 

Drupal is a registered trademark of Dries Buytaert.