[development] Curl-based content generation

Jimmy Berry jimmy at boombatower.com
Thu Feb 5 22:46:39 UTC 2009


@Marco:

If you used a the abstract browser and a script you could programmatically
access any feature provided through Drupal's web interface from a script on
a local machine. The script could login to the remote server and perform any
action the user can.

Using the core browser you only need to specify the values you would as a
user...all the default values are already picked up and sent as a standard
broswer does (ie. checkbox states, hidden values, etc).

Having such a tool would allow you to programmatically perform numerous
operations on any number of remote servers with a single command. I see a
great use being the update script that would allow you to run it on any
number of sites at once, instead of navigating to each manually.

This method requires no additional setup or configuration of the server.
Just run the script and it will act as though it were a standard user
browsing the site. To create a node you would need something like this:

$edit = array(
  'title' => 'New node',
  'body' => 'Some text'
);
$browser->post('http://example.com/node/add/page', $edit, 'Submit');

You can see how simple it would be to perform just about any operation as it
already deals with cookies and such.

Jimmy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20090205/539c7777/attachment.htm 


More information about the development mailing list