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

andrew morton drewish at katherinehouse.com
Sun Jan 4 11:13:31 UTC 2009


On Sun, Jan 4, 2009 at 12:39 AM, M. Fioretti <mfioretti at nexaima.net> wrote:
> 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?

There was a discussion at the Portland Drupal Group about using the
SimpleTest module to do this type of thing. If nothing else it should
be a good place to steal some code. There are likely unit tests for
HEAD that would do what you're describing.

Good luck,
andrew


More information about the development mailing list