[development] Info needed to add content to Drupal via shell/curl script
remorse at partners.org
Wed Jan 7 16:25:30 UTC 2009
Hi! In this particular case, I had some special variables I needed
added, and I wanted to restrict the ability to post to certain IP
addresses and user(s). I did look at services, and it was more than I
needed or wanted...
On Jan 7, 2009, at 11:16 AM, Greg Dunlap wrote:
> On the Drupal side, you should also look at the Services module, which
> offers XML-RPC services for creating nodes as well as many other
> On Wed, Jan 7, 2009 at 8:01 AM, Richard Morse <remorse at partners.org>
>> I developed something similar which uses the XML-RPC mechanism to
>> nodes. I wrote a custom module to receive the data, create a node
>> and call node_save() on it. To submit the data, I used Perl.
>> If you're interested, I can send you the code.
>> On Jan 4, 2009, at 3:39 AM, M. Fioretti wrote:
>>> 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
>>> 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
>>> 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
>>> 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
>>> - how much the two answers above depend on drupal version, or will
>>> 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
>>> are installed.
>>> So, is there any official documentation which contains complete,
>>> answers to the questions above? In other words, is there a better,
>>> reliable and future-proof way to get those answers than studying
>>> code or raw http sessions by trial and error?
>>> Thank you in advance for any feedback and happy 2009!
>>> Help *everybody* love Free Standards and Software:
>> The information in this e-mail is intended only for the person to
>> whom it
>> addressed. If you believe this e-mail was sent to you in error and
>> contains patient information, please contact the Partners Compliance
>> HelpLine at
>> http://www.partners.org/complianceline . If the e-mail was sent to
>> you in
>> but does not contain patient information, please contact the sender
>> dispose of the e-mail.
More information about the development