I want to add a widget to a web page that will allow user to enter search
terms and search wikimedia for images that match the terms. I have
implemented a similar widget for flickr, using their API, but am having
trouble doing the same with wikimedia.
Basically, I would like to replicate the functionality of the
commons.wikimedia.org search page. Ideally I would like to be able to get a
Category listing (ex. http://commons.wikimedia.org/wiki/Chartres_Cathedral)
or a true search results (ex.
but at this point I would be happy with either.
I've tried using the allimages list, but that is not adequate. Is there any
other way to search images using the API?
I have also been looking at Freebase and DBPedia. These seem like they
might do what I want, but RDF is completely new to me and I'm still trying
to figure out the basics of it. If anyone can point me in the right
direction for either of those resources, I would appreciate it.
I posted this on the talk page for the API. Trying to find an answer.
I did try with 16.5, but still the same error, it is reporting a doubled Content-Length. Where
in the code is the header formed for content length? Or is it relying on server?
Doubled Content-Length in HTTP Header
MediaWiki version: 16.0 - also tried 16.5
PHP version: 5.2.17 (cgi)
MySQL version: 5.0.91-log
I am trying to track down a bug in the api which is causing a double content-length in the
header. This is causing a lot of issues with a python bot. Here is the report from web-sniffer
showing the content of the api.php call from this wiki. All other pages when called, i.e. the
Main page, etc. only report 1 content-length. Is the api forcing the headers? Why is doubling
only the one?
Status: HTTP/1.1 200 OK
Date: Mon, 30 Jan 2012 14:31:25 GMT
Content-Type: text/html; charset=utf-8 Connection: close
Server: Nginx / Varnish
As you can see this is a Nginx server. On an Apache server with 16.0, only one content-length is
sent. Could that be the issue and how do I solve it? Thanks.
I am working on an extension and would like to add some functionality to the 'usercontribs' api module (api/ApiQueryUserContributions.) I cannot subclass the ApiQueryUserContributions class and get the functionality I want because there are a number of methods that have a 'private' scope. Is there a reason that these are private and not protected?
Senior Software Engineer
Vistaprint Make an impression.
Business Cards are FREE at www.vistaprint.com!
Thanks for the answer.. One follow-up..
Not sure what the acceptable way to answer these...
>> 1.?????? Is this the preferred way to ask questions? Is there a
>> web-based forum I can use to ask questions/search for answers?
Can you provide it? I can't find it.
1. Is this the preferred way to ask questions? Is there a web-based forum I can use to ask questions/search for answers?
2. My questions: I am using the api's action=parse operation and am getting HTML that corresponds to said article.
a. Is there a way to avoid redirect in pages (automatically get all-resolved URLs)
b. Which CSS should I include in my HTML so that the formatting of the HTML will work properly? Not all styles are inlined. I could not find any info about this (really hard to search for Wikipedia-related programming elements - you keep hitting, well, Wikipedia. :))
I am having a perplexing problem trying to retrieve a list of querypage
results. The problem is that when I access the API from a script, I can
only retrieve 1000 results from the API, while if I use exactly the same
query manually in a browser, I can retrieve up to 5000 results. Here is an
example of the query:
When I put this query into Firefox manually, it returns the expected 100
results, plus a "query-continue" key. However, when I run exactly the same
query from a Python script, it returns the same 100 results, but no
"query-continue". (When qpoffset is less than 900, the script *does* return
the "query-continue" key, the problem only occurs when trying to go past
The _only_ difference I can identify between the two queries is that the
browser is doing an HTTP GET, while the Python script is doing an HTTP POST.
Everything else is identical, which I have verified by logging the queries
sent and responses received by the script and comparing them to my manual
Should GET vs. POST make a difference in the results returned by
list=querypage? I've never seen this happen on any other type of API query.
If that's not it, is there any other possible explanation?
This week and next week, I'm aiming to work on improving the
documentation and tutorials for MediaWiki's web service API. I've
already gotten a volunteer to redo
and am aiming on getting volunteers to improve the rest of the API:
pages on mediawiki.org in the next few weeks. Now would be a great time
for you to put feedback and "I wish this covered...." notes on Talk pages.
Also, Max Semenik wrote a new GUI tool to help newbies explore the
MediaWiki API. It's called the API Query Sandbox. You can try it here:
and an improved version (not yet deployed) here:
Please file bugs and enhancement requests in bugzilla.wikimedia.org
(Product: MediaWiki extensions, Component: ApiSandbox). We want to make
Volunteer Development Coordinator