[development] Info needed to add content to Drupal via shell/curl script

Richard Morse remorse at partners.org
Wed Jan 7 16:01:55 UTC 2009


I developed something similar which uses the XML-RPC mechanism to  
create nodes. I wrote a custom module to receive the data, create a  
node object, and call node_save() on it. To submit the data, I used  
Perl.

If you're interested, I can send you the code.

Ricky

On Jan 4, 2009, at 3:39 AM, M. Fioretti wrote:

> Greetings,
>
> I would like to ask all Drupal developers where to find the info to do
> what I describe below. I have already found almost identical questions
> asked both on the support list and in the forums at drupal.org, but  
> they
> did not receive complete answers, so here I am.
>
> I want to write a shell script which takes as input an HTML file and  
> other
> parameters (title, category, etc...) and then, using curl and the POST
> method, logs into a Drupal website, adds a node with that text and
> parameters, logs off and returns the complete URL assigned by drupal  
> to
> that page.
>
> The information I need is:
>
> - what is the exact sequence of pages (relative URLs) that drupal  
> presents
> to users who login and then want to add a node?
> - what is the complete list of POST parameters (assuming there is  
> only one
> custom category CAT_1) that drupal wants to see POSTed to each of  
> those
> pages?
> - how much the two answers above depend on drupal version, or will  
> change
> in the future?
>
> Important: I know I can look at all the http headers going back and  
> forth
> between browser and drupal, and using this approach I have *already*
> written a working draft of the script myself, but I'm looking for a
> better, more reliable way to do this. I found that the script won't  
> work
> consistantly, meaning that I'd have to tweak it every time if Drupal
> version changes or (usign it on other sites) depending on which  
> modules
> are installed.
>
> So, is there any official documentation which contains complete,  
> reliable
> answers to the questions above? In other words, is there a better,  
> more
> reliable and future-proof way to get those answers than studying  
> source
> code or raw http sessions by trial and error?
>
> Thank you in advance for any feedback and happy 2009!
>
> Marco
>
> -- 
> Help *everybody* love Free Standards and Software:
> http://digifreedom.net
>



The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.



More information about the development mailing list