Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I have a requirement where I will have to insert content (nodes) from the command line. I know that drupal bootstraping is needed to acces the environment, and this can be done using PHP.

Is there any tool that can create/modify/read content from the command line ? Are there any other programming language binds (besides PHP) ? What are the options ?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

I think the best option would be to go with the Services module. About the module from the project page:

A standardized solution of integrating external applications with Drupal. Service callbacks may be used with multiple interfaces like REST, XMLRPC, JSON, JSON-RPC, SOAP, AMF, etc. This allows a Drupal site to provide web services via multiple interfaces while using the same callback code.

You can build the other application (like android app, Java app, and many more...) in any programming languages you like and make the application interact with Drupal using Services. There is an extensive documentation available which would help you through.
Take time to read through the project page (as it contains more resources to explore) and the documentation as it might take time to get accustomed with the module (as it happened with me).

For command line access to Drupal there is a "Command line shell and scripting interface" - Drush (Drupal Shell). List of the Drush commands could be found at this site. It is very powerful utility for Drupal developers (on Windows, Ubuntu Linux, Mac, etc.); but I'm not sure if one is able to create/modify/read content (nodes) with Drush though, I think one cannot do that (please correct me if I'm wrong).

share|improve this answer
    
In the end this seems to be the best approach. –  drcelus Nov 26 '12 at 14:38
1  
@drcelus if that is the case you should also have a look at this session : Services Inside out at DrupalCon Denver. It shows similar examples towards the end. –  AjitS Nov 26 '12 at 14:45

You can check Drush and Drush Entity. Drush is a powerfull command line script for drupal and you can do a bundle of thing with it (install module, clear cache...). I have never worked with Drush Entity but it add interactions with entities for Drush.

share|improve this answer
    
+1 Drush Entity sounds promising :) –  AjitS Nov 22 '12 at 8:18
    
Unfortunately, the project lacks any kind of documentation and thus it's really hard to start with. –  drcelus Nov 26 '12 at 14:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.