Hello,
I am writing a Java program to extract the abstract of the wikipedia page
given the title of the wikipedia page. I have done some research and found
out that the abstract with be in rvsection=0
So for example if I want the abstract of 'Eiffel Tower" wiki page then I am
querying using the api in the following way.
http://en.wikipedia.org/w/api.php?action=query&prop=revisions&titles=Eiffel…
and parse the XML data which we get and take the wikitext in the tag <rev
xml:space="preserve"> which represents the abstract of the wikipedia page.
But this wiki text also contains the infobox data which I do not need. I
would like to know if there is anyway in which I can remove the infobox data
and get only the wikitext related to the page's abstract Or if there is any
alternative method by which I can get the abstract of the page directly.
Looking forward to your help.
Thanks in Advance
Aditya Uppu
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.
http://commons.wikimedia.org/w/index.php?title=Special%3ASearch&search=%22c…),
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.
Regards.
Tim Helck
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
URL: www.isogg.org/w/api.php
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
X-Powered-By: PHP/5.2.17
MediaWiki-API-Error: help
Cache-Control: private
Content-Encoding: gzip
Vary: Accept-Encoding
Content-Length: 16656
Content-Length: 16656
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.
Tom
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?
Daniel Renfro
Senior Software Engineer
T: 781-652-6465
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?
>>
>Yes.
Can you provide it? I can't find it.
s
Hi,
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. :))
Thanks,
s
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:
http://simple.wikipedia.org/w/api.php?action=query&list=querypage&qppage=Di…
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
offset 1000.)
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
queries.
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
https://www.mediawiki.org/wiki/API:Main_page
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:
https://en.wikipedia.org/wiki/Special:ApiSandbox
and an improved version (not yet deployed) here:
http://mobile-feeds.wmflabs.org/w/index.php/Special:ApiSandbox
Please file bugs and enhancement requests in bugzilla.wikimedia.org
(Product: MediaWiki extensions, Component: ApiSandbox). We want to make
this better.
Thanks!
--
Sumana Harihareswara
Volunteer Development Coordinator
Wikimedia Foundation