Last modified: 2013-03-22 14:26:07 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T44533, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 42533 - Creating parser functions (magic words) to query the API local and interwiki
Creating parser functions (magic words) to query the API local and interwiki
Status: NEW
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.21.x
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-29 09:38 UTC by billinghurst
Modified: 2013-03-22 14:26 UTC (History)
6 users (show)

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


Attachments

Description billinghurst 2012-11-29 09:38:00 UTC
At the moment it is not possible to create easily migratable parser functions, they all need a copy and paste, and an amendment for the local server.  It would be great if there was able to be added to the magic words and parser functions that can used and applied to the api.  For example

* {{localurl:page name|query_string}}  -> {{localurl:MediaWiki|printable=yes}} → /w/index.php?title=MediaWiki&printable=yes

Here I am thinking {{localapi}} ->  /w/api.php?...


* {{fullurl:interwiki:remote page name|query_string}}
Here I am thinking {{fullapi:+++}} so we can more easily build lists of xwiki api calls.

My reason is that sometimes there are queries that I want to share to others, and and having it being local to the server running it without changing components would be useful.  Plus to build a page to run a query on a series of wikis (eg. show me the count of admins and bureaucrats) and building those with shortcuts and without parser functionality is a nightmare.
Comment 1 Brad Jorsch 2012-11-29 13:54:11 UTC
This isn't really "API", it's asking for magic words to get API paths.

To get your "localapi", you should be able to use something like {{SERVER}}{{SCRIPTPATH}}/api.php. You could wrap that in a template if you'd like.

For interwiki linking, you'd have to get the API paths for every interwiki link stored somewhere first. Right now it just blindly translates something like de:$1 to //de.wikipedia.org/wiki/$1, based on the patterns into the interwiki map.

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


Navigation
Links