[development] Back to Curl-based content generation

Jamie Holly hovercrafter at earthlink.net
Thu Feb 19 13:57:17 UTC 2009

M. Fioretti wrote:
> On Thu, Feb 19, 2009 14:54:51 PM +0200, Ashraf Amayreh wrote:
> > You could always simply run a curl script that just mimics a login
> > then page submission.
> honestly, this is getting funny now. This is exactly what *I* asked
> here weeks ago: info and documentation to put together just such a
> script with the minimum possible amount of manual trial and error,
> http headers sniffing and so on. Nothing more.
> Marco

Request the node/add/{node-type}page. Grep out all the input elements 
along with their default values. Change the needed default values (ie: 
title, body, etc.) then resubmit it via a post request to the same URL. 
If you want to catch error messages then you have to grep out the error 
division of the URL you submitted to.

As far as what data is required - well that depends upon the site's 
configuration. It depends upon modules the site has enabled, how the 
content type is configured, what options are available to the current 
user's access level, etc.

The only other option is the one stated numerous times - using a module. 
Either activate the Blog API module (and use XML-RPC), or use something 
like the services module. Now I have seen your reply about this:

>No, as I already said several times in this thread. More exactly: I do
>control the one where I'd need this first, but not others on which
>I'll have to work soon, that's why I'm looking for one solution which
>doesn't rely on access to server. So, this wouldn't work, would it:

If you are doing this for other sites, then I can only assume it's 
because they are asking you to (if not then that opens up a whole new 
debate on ethics). If that's the case then can't you simple ask them to 
install a module for this, even if it's as simple as activating the 
BlogAPI module?

More information about the development mailing list