Last modified: 2014-03-14 22:37:43 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 36520 - Create an API for Extension:ShortURL
Create an API for Extension:ShortURL
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
ShortUrl (Other open bugs)
All All
: Low enhancement (vote)
: ---
Assigned To: Yuvi Panda
Depends on:
Blocks: noncoreapi
  Show dependency treegraph
Reported: 2012-05-04 15:51 UTC by Srikanth Logic
Modified: 2014-03-14 22:37 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Srikanth Logic 2012-05-04 15:51:32 UTC
Create an API which will give shorturl of any page and also long form any shorturl
Comment 1 Sam Reed (reedy) 2012-05-04 21:24:24 UTC
(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?
Comment 2 Yuvi Panda 2012-05-04 21:37:23 UTC
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...
Comment 3 Yuvi Panda 2012-05-08 08:08:51 UTC
Should add a prop=shorturl to action=query?
Comment 4 Sam Reed (reedy) 2012-07-30 16:36:51 UTC
(In reply to comment #3)
> Should add a prop=shorturl to action=query?

Sounds about right
Comment 5 Daniel Norton 2014-02-25 23:39:44 UTC
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:|Test%20target%202|User%20talk:Danorton|User:Danorton

Valid sub-properties are "code", "path" and "ns".
Comment 6 Daniel Norton 2014-03-14 04:00:18 UTC
Okay, well, I did it anyway. I have yet to move it over and go through review, but here it is on my github:
Comment 7 Daniel Norton 2014-03-14 22:37:43 UTC

Note You need to log in before you can comment on or make changes to this bug.