wikimedia/WiktionaryMobile — pull request #23 by dlemieux (2012-04-02 08:57:50+00:00)
Title: Gracefully handle sharing from Wiktionary to Wiktionary

This detects if we are coming from Wiktionary by seeing if we were given a Wiktionary URL.
If so, then it extracts the word to define from the URL.
Since we personally know the Wikipedia app I also provide the possibility to parse the URL that they share with us, however this is not a solution that will easily scale to other MediaWiki products.

Additionally, if we are given any other types of url we will not know how to extract the word to define. We can either leave it at that or try to employ some kind of best guess. Example, the last term after a slash character, or check for get parameters like "?term=" or "?word=" or "?q=".

Feel free to comment.