Jan Luca | 1 Jan 2011 18:13
Picon

Problem with URL parameters and action=uplaod

Hi,

I have a problem with the API and following HTTP-request (PHP-Code):

$message = 
"--".$boundary."
Content-Type: application/x-www-form-urlencoded

ignorewarnings=1&token=".urlencode($token)."&filename=".urlencode($new_file)
."&file=".urlencode("file")."&comment=".urlencode($desc)."

--".$boundary."
Content-Type: application/octet-stream
Content-Disposition: form-data; name=\"file\"; filename=\"".$new_file."\"

".$file."
--".$boundary."--";

$query = "POST ".$this->server_dir."/api.php?format=php&action=upload
HTTP/1.1
Host: ".$this->server."
Cookie: ".$this->cookies."
User-Agent: CommonsHelper2/1.0 Beta
(http://toolserver.org/~commonshelper2/index.php jan <at> toolserver.org)
Content-Type: multipart/form-data; boundary=".$boundary."
Content-Length: ".strlen($message)."

".$message."
\r\n\r\n";

(Continue reading)

Bryan Tong Minh | 1 Jan 2011 18:34
Picon
Gravatar

Re: Problem with URL parameters and action=uplaod

On Sat, Jan 1, 2011 at 6:13 PM, Jan Luca <jan <at> jans-seite.de> wrote:
> Hi,
>
> I have a problem with the API and following HTTP-request (PHP-Code):
>
> $message =
> "--".$boundary."
> Content-Type: application/x-www-form-urlencoded
>
> ignorewarnings=1&token=".urlencode($token)."&filename=".urlencode($new_file)
> ."&file=".urlencode("file")."&comment=".urlencode($desc)."
>
> --".$boundary."
> Content-Type: application/octet-stream
> Content-Disposition: form-data; name=\"file\"; filename=\"".$new_file."\"
>
> ".$file."
> --".$boundary."--";
>
I have never tried mixing x-www-form-urlencoded with
multipart/form-data. Try encoding each field as their own part in the
multipart blob.

Another tip, always sent the edit token as the last field. If you send
the edit token before the file and your upload gets interrupted half
way, a half uploaded file will appear. PHP does not care about your
Content-Length header...

Bryan
(Continue reading)

Dropbox | 4 Jan 2011 08:58

Saeed Ahmed invited you to Dropbox

Saeed Ahmed wants you to use Dropbox to sync and share files online and across computers.

Get started here.

- The Dropbox Team
To stop receiving invites from Dropbox, click here © 2010 Dropbox
_______________________________________________
Mediawiki-api mailing list
Mediawiki-api <at> lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
saeed ahmed | 4 Jan 2011 09:08
Picon

Re: Saeed Ahmed invited you to Dropbox

hello all group members, 


I apologize for this out topics email to this group. I'm very sorry for this mistake

saeed 

On Tue, Jan 4, 2011 at 1:58 PM, Dropbox <no-reply <at> dropboxmail.com> wrote:
Saeed Ahmed wants you to use Dropbox to sync and share files online and across computers.

Get started here.

- The Dropbox Team
To stop receiving invites from Dropbox, click here © 2010 Dropbox

_______________________________________________
Mediawiki-api mailing list
Mediawiki-api <at> lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api


_______________________________________________
Mediawiki-api mailing list
Mediawiki-api <at> lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Marc Kerbiquet | 4 Jan 2011 19:20
Picon

Absolute URLs with action=parse

Hi,

Is there an option to get absolute URLs with action=parse ?

For instance, I would like to get "http://en.wikipedia.org/wiki/..."
instead of "/wiki/..." in src and href attributes. I can parse the HTML
returned by the API and transform URLs, but I wonder if there is an
easier method.

Thanks,
Marc Kerbiquet
Roan Kattouw | 4 Jan 2011 20:09
Picon

Re: Absolute URLs with action=parse

2011/1/4 Marc Kerbiquet <mkerbiquet <at> gmail.com>:
> Hi,
>
> Is there an option to get absolute URLs with action=parse ?
>
> For instance, I would like to get "http://en.wikipedia.org/wiki/..."
> instead of "/wiki/..." in src and href attributes. I can parse the HTML
> returned by the API and transform URLs, but I wonder if there is an
> easier method.
>
action=render does this:

http://en.wikipedia.org/w/index.php?title=Albert_Einstein&action=render

Having it in action=parse would be nice, but because of the way this
stuff is written (checking whether the action parameter equals
'render' and adding it if so) that's probably tricky.

Roan Kattouw (Catrope)
Marc Kerbiquet | 4 Jan 2011 20:55
Picon

Re: Absolute URLs with action=parse

On Tue, Jan 4, 2011 at 8:09 PM, Roan Kattouw <roan.kattouw <at> gmail.com> wrote:
> 2011/1/4 Marc Kerbiquet <mkerbiquet <at> gmail.com>:
>> Hi,
>>
>> Is there an option to get absolute URLs with action=parse ?
>>
>> For instance, I would like to get "http://en.wikipedia.org/wiki/..."
>> instead of "/wiki/..." in src and href attributes. I can parse the HTML
>> returned by the API and transform URLs, but I wonder if there is an
>> easier method.
>>
> action=render does this:
>
> http://en.wikipedia.org/w/index.php?title=Albert_Einstein&action=render
>
> Having it in action=parse would be nice, but because of the way this
> stuff is written (checking whether the action parameter equals
> 'render' and adding it if so) that's probably tricky.
>
> Roan Kattouw (Catrope)
>

Thanks, but I forgot to mention that I also use the 'text' attribute and
the headhtml prop in a POST with action=parse. I use this command to
implement a preview in an external editor (the text is not in the database
yet).

It would be nice if it was possible to implement an option to get absolute
urls but a simple replace does the trick as long as the page does not
contain source HTML :-)

Cheers,
Marc
Platonides | 4 Jan 2011 21:55
Picon

Re: Absolute URLs with action=parse

Marc Kerbiquet wrote:
> Thanks, but I forgot to mention that I also use the 'text' attribute and
> the headhtml prop in a POST with action=parse. I use this command to
> implement a preview in an external editor (the text is not in the database
> yet).
> 
> It would be nice if it was possible to implement an option to get absolute
> urls but a simple replace does the trick as long as the page does not
> contain source HTML :-)
> 
> Cheers,
> Marc

You can also make it the other way. Provide all your local URLs as
absolute ones, and point the relatives to the wiki with <base href=
Marc Kerbiquet | 4 Jan 2011 22:28
Picon

Re: Absolute URLs with action=parse

> You can also make it the other way. Provide all your local URLs as
> absolute ones, and point the relatives to the wiki with <base href=

Thank you, that's exactly what I need.

Cheers,
Marc
Nicolas Vervelle | 5 Jan 2011 21:27
Picon

Problem with "embeddedin" and query continue ?

Hi,


I am using the API to retrieve a list of pages where a template is embedded.
It was working correctly last week but now I have a problem with the query continue :

Nico
_______________________________________________
Mediawiki-api mailing list
Mediawiki-api <at> lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api

Gmane