[support] I can't believe you can't add content from the command line...

Bèr Kessels ber at webschuur.com
Tue Jul 4 14:06:20 UTC 2006


Have a look at sympal_scripts 
http://cvs.drupal.org/viewcvs/drupal/contributions/tricks/sympal_scripts/

It contains an easy way to include Drupal on commandline. 

Some form of insert content script is on my todolist, but not done yet.

in any case, including Drupal with sympal scripts is not hard, and after that 
you can simply say:
 node_save($node)  to save your node object.

Anything else *will* break, talking directly to the database is a very bad 
idea, since a lot of modules have data that is inserted when they are called 
by node_save()

Bèr



Op zondag 2 juli 2006 17:45, schreef dondi_2006:
> Hello,
>
> Some days ago I had asked on this list how to add content in
> Drupal from the mysql command line.
> I only got one suggestion to try the import_HTML module
> (http://drupal.org/node/46008) but it really seems an overkill, and not the
> best approach to what I have to do.
>
> I had also asked how to do the same thing in two different ways in
> the forums:
> http://drupal.org/node/62954
> http://drupal.org/node/68605
>
> without result so far: no feedback from others who posted, who I contacted
> directly, no usable documentation I could recognize, nothing...
>
> Honestly, I can't believe this has never been done before: What
> I need to do is something that (OUTSIDE Drupal) reads a .txt file like
> this:
>
> ARTICLE_CATEGORIES="travel/england/london,  food/foreign/restaurants"
> TEXT="path/to/some/local/html/file/"
> CREATED_ON_DATE="YYYY/MM/DD"
> AUTHOR="John Doe"
>
> etc etc.... (other variables like, for example,
> "create_a_forum_for_this_node")
>
> and upload the node inside the Drupal database, just if I had inserted
> everything by hand in the proper drupal form.
>
> I don't want to do it via drupal because I need this to happen regularly 
> and automatically (say, a cron job on my home PC which publishes via ssh
> whatever file in $DRUPAL_CONTENT folder changed in the last hour): it's not
> a one-time job.
>
> I've also tried to look for scripts doing this via the blogger API
> (or usable documentation on how to write them so they _are_ drupal
> compatible): nothing.
>
> What am I missing? Is it really possible that everybody is happy
> pasting and changing stuff manually in a tiny textarea, EVERY
> darned time some node must be added or updated??
>
> Thanks,
>
> O.


More information about the support mailing list