Hi everyone,
as a multilingual user of Wikipedia, I am always looking for new ways of
using and accessing the content from different language wikis. I am
Norwegian, but I read Chinese and I have several friends who often edit
there. Whoever, if I want to look up an article in Chinese Wikipedia, it's a
hassle since I don't necessarily know how they write "Oslo" or
"Plato" in
Chinese... so I did this little tool
http://70.47.70.10/redir/en/zh/Oslo
it will automatically git you the page in Chinese Wikipedia that is
interlinked from the article about Oslo in the English Wikipedia. (This
works for all language combinations - given that there are interwiki links -
and all articles. Use _ instead of spaces).
http://70.47.70.10/redir/no/ar/Demokrati
Sounds kinda useful ... do we have a special page that does this? Should we?
e.g. [[Special:Interwiki/ar/Demokrati]] on :no could return an HTTP redirect to
http://ar.wikipedia.org/wiki/%D8%AF%D9%8A%D9%85%D9%82%D8%B1%D8%A7%D8%B7%D9%…
If so, it should be filed in bugzilla (
http://bugzilla.wikimedia.org/enter_bug.cgi?product=MediaWiki )
it only downloads the first article, does a quick
regexp, and forwards to
the second article. I have posted about this on the Norwegian and Indonesian
community pages. Not sure what is the place to list this tool on the English
wiki / MediaWiki?
Rather than downloading and doing a regexp, maybe have a quick look at the
MediaWiki API. Example for the Poland page, this essentially gives just the interwiki
links:
http://en.wikipedia.org/w/api.php?action=query&prop=langlinks&title…
Docs on API:
http://www.mediawiki.org/wiki/API
See also:
http://en.wikipedia.org/w/api.php
Another thing that has struck me is that being able to
read several
languages, I often don't really mind that much which wiki a certain article
comes from - but I would like to read the longest or most complete article
on a given topic. However in practice I find myself often "constrained" to
the English Wikipedia because that is generally the best, or the Indonesian
if I am reading on Indonesian topics etc.
so this url
http://70.47.70.10/bigger/en/no,sv,id,ms/Poland
will automatically redirect you to whatever of the articles in no, sv, id or
ms that is _longer_ (pure bytesize, not very scientific but still) of the
articles links from the English Poland page.
This is insanely useful (it's mainly meant to be a Firefox bookmark - plug
in the languages you are comfortable reading in, call it big, and whenever
you want an article type big Television, and you will get the longest
article in one of the languages you know).
Nice! Worth considering for inclusion in-core? (If so, a bug report should be
filed, same as per the above).
However - right now what it's doing is downloading
a full page from each of
the Wikipedias, to find the size. So in the above example, it would download
five full pages, before redirecting the user to one of them (causing it to
be downloaded again)... I'm obviously not happy about wasting Wikipedia
bandwidth, so I wonder if there is a better way of doing this - getting just
the size of any given page... I will not post this online anywhere else,
until I have some guidance from this list.
You could maybe try using the HTTP HEAD command, which will give you a quick header,
including the length of the page in bytes, without having to retrieve it all.
E.g. if you have the cURL command line program, you could try the commands below,
and the Content Length returned is shown after the "-->".
curl --head 'http://no.wikipedia.org/wiki?title=Polen&action=raw' -->
68319 bytes
curl --head 'http://sv.wikipedia.org/wiki?title=Polen&action=raw' -->
35746 bytes
curl --head 'http://id.wikipedia.org/wiki?title=Polandia&action=raw' -->
6576 bytes
curl --head 'http://ms.wikipedia.org/wiki?title=Poland&action=raw' -->
10546 bytes
(Note: I couldn't see anything in the API that gave the article size when searching in
the docs for "size", "byte", or "length", but it's
arguable that maybe it could be included
in the prop=info request - e.g. could maybe include the page length in bytes in this:
http://en.wikipedia.org/w/api.php?action=query&prop=info&titles=Pol… )
-- All the best,
Nick.