On Feb 4, 2008 12:53 PM, catrope@svn.wikimedia.org wrote:
(bug 12905) Created [[Special:API]] which just 302s to $wgScriptPath/api.php
Isn't 301 more appropriate?
Simetrical schreef:
On Feb 4, 2008 12:53 PM, catrope@svn.wikimedia.org wrote:
(bug 12905) Created [[Special:API]] which just 302s to $wgScriptPath/api.php
Isn't 301 more appropriate?
I have absolutely no idea. OutputPage::redirect() uses 302 by default, so that's what I used. Feel free to change it to whatever you feel is appropriate.
Roan Kattouw (Catrope)
Ok, so that method didn't work out. Is there still room for discussion on another way to allow MediaWiki to easily access the API on another MediaWiki wiki, even if it's only given shorturl information such as what is inside of an interwiki link?
It may be ok for other applications like bots and such which easily reuse the same data, but it's not a good idea to force a MediaWiki extension to grab a page from MediaWiki, hack out the scriptPath from there using some ugly regex, and then make it's query to the api. And need to do that on each new page request which requires an api call to that wiki. If the extension wants to support something through InterWiki which requires some info from the api.
The other two methods I can think of, are a url parameter, something like &action=api, or back to [[Special:API]], except instead make it return the url of the api as text if it is enabled. Directly giving the url of the api is better than making it need page parsing.
~Daniel Friesen(Dantman) of: -The Gaiapedia (http://gaia.wikia.com) -Wikia ACG on Wikia.com (http://wikia.com/wiki/Wikia_ACG) -and Wiki-Tools.com (http://wiki-tools.com)
Roan Kattouw wrote:
Roan Kattouw schreef:
Feel free to change it to whatever you feel is appropriate.
Oh wait, Brion reverted it. Maybe I should read mediawiki-cvs before wikitech-l :D
Roan Kattouw (Catrope)
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/wikitech-l
On Feb 6, 2008 4:14 AM, DanTMan dan_the_man@telus.net wrote:
It may be ok for other applications like bots and such which easily reuse the same data, but it's not a good idea to force a MediaWiki extension to grab a page from MediaWiki, hack out the scriptPath from there using some ugly regex, and then make it's query to the api.
Extensions have access to $wgScriptPath so will be able to access api.php via $wgScriptPath . 'api.php'.
Extensions have access to $wgScriptPath on THEIR wiki, not another wiki through interwiki. This is for extensions trying to get data on OTHER wiki, of which they have no knowledge of the script path.
~Daniel Friesen(Dantman) of: -The Gaiapedia (http://gaia.wikia.com) -Wikia ACG on Wikia.com (http://wikia.com/wiki/Wikia_ACG) -and Wiki-Tools.com (http://wiki-tools.com)
Minute Electron wrote:
On Feb 6, 2008 4:14 AM, DanTMan dan_the_man@telus.net wrote:
It may be ok for other applications like bots and such which easily reuse the same data, but it's not a good idea to force a MediaWiki extension to grab a page from MediaWiki, hack out the scriptPath from there using some ugly regex, and then make it's query to the api.
Extensions have access to $wgScriptPath so will be able to access api.php via $wgScriptPath . 'api.php'.
On Feb 6, 2008 4:28 AM, Minute Electron minuteelectron@googlemail.com wrote:
Extensions have access to $wgScriptPath so will be able to access api.php via $wgScriptPath . 'api.php'.
If we were talking about an extension using the API for the wiki it's running on, I sure hope it's not trying to do so via HTTP.
On Feb 5, 2008 9:26 AM, Roan Kattouw roan.kattouw@home.nl wrote:
Simetrical schreef:
Isn't 301 more appropriate?
I have absolutely no idea. OutputPage::redirect() uses 302 by default, so that's what I used. Feel free to change it to whatever you feel is appropriate.
302 Found is a temporary redirect:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.3
301 Moved Permanently is a permanent one:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.2
If you know (as here) that the redirect target will never change, you should always use 301, not 302. (And if you know that it might change, you should consider using 303 or 307 as appropriate, instead of 302, but that's a separate question.)
wikitech-l@lists.wikimedia.org