I'm trying to write an xml parser that creates event nodes, and perhaps other types of nodes too. This script should get called by cron every so often to insert or update nodes, and therefore not require a logged in user. How would I do the actual node insertion though? Say that I know that I've found my event title, start time etc., do I use event_nodeapi to create it? How exactly? Or do have to do a database insert/update...?

Eventually the nodes should have a lot of extra fields, including an imagefield, I'm guessing I'll use CCK to create this, seeing as that seems to be the way to go...

Comments

geodaniel’s picture

I've been looking at doing something similar too, and I was going to base my code off what the aggregator modules do (like aggregator2 and leech), all of which appear to use the node_save API function. That's the proper way to go, as simply inserting the new nodes into Drupal's node table could cause issues.