Create an API for Extension:ShortURL
Open, LowPublic

Description

Create an API which will give shorturl of any page and also long form any shorturl


Version: unspecified
Severity: enhancement

Details

Reference
bz36520

Related Objects

bzimport raised the priority of this task from to Low.
bzimport set Reference to bz36520.
Logicwiki created this task.May 4 2012, 3:51 PM
Reedy added a comment.May 4 2012, 9:24 PM

(In reply to comment #0)

Create an API which will give shorturl of any page and also long form any
shorturl

So you want a way to get the short url for a page? And also a way to turn that short url back into a long url?

IMO turning a shorturl back into a long URL should be a simple HTTP HEAD request. But I guess an API for 'symmetry' also makes sense...

Should add a prop=shorturl to action=query?

Reedy added a comment.Jul 30 2012, 4:36 PM

(In reply to comment #3)

Should add a prop=shorturl to action=query?

Sounds about right

daniel wrote:

An action=query property is valid for converting from a title to a short URL, but I don't think that's possible for the other way around. I think there needs to be a separate action for translating from a short URL to a page.

I have implemented a version of the query API on my own server. (I'm a n00b, so I'm still figuring out the framework.) Here's an example query:

https://wkil.org/w/api.php?action=query&prop=shorturl&suqprop=path&titles=Test%20target%201|Test%20target%202|User%20talk:Danorton|User:Danorton

Valid sub-properties are "code", "path" and "ns".

daniel wrote:

Okay, well, I did it anyway. I have yet to move it over and go through review, but here it is on my github: https://github.com/danorton/mw-ext-shorturlapi

yuvipanda removed yuvipanda as the assignee of this task.Dec 17 2014, 10:28 PM
yuvipanda set Security to None.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 29 2015, 1:57 PM