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
Hi, All!
I found a very strange thing about the continue tokens:
The link is here:
http://commons.wikimedia.org/w/api.php?action=query&format=xml&revids=37692…
I got the following response:
<api>
<query>
<pages>
<page pageid="1246719" ns="6" title="File:AB towns+names.png"
imagerepository="local" contentmodel="wikitext" touched="
2012-04-26T19:25:33Z" lastrevid="37692183" counter="" length="447">
<categories>
<cl ns="14" title="Category:Locator maps of cities in Alberta"/>
<cl ns="14" title="Category:Maps of Alberta"/>
<cl ns="14" title="Category:PD-self"/>
</categories>
<imageinfo>
<ii size="82937" width="524" height="700" url="
http://upload.wikimedia.org/wikipedia/commons/1/1d/AB_towns%2Bnames.png"
descriptionurl="http://commons.wikimedia.org/wiki/File:AB_towns%2Bnames.png"
sha1="0753be62082948bceb1db4205e75d4cf819dbbfa"mime="image/png" bitdepth="8
"/>
</imageinfo>
<revisions>
<rev revid="37692183" parentid="25300971" minor="" user="Qyd" timestamp="
2010-04-16T02:38:20Z" comment="/* {{int:filedesc}} */ gallery" contentformat
="text/x-wiki" contentmodel="wikitext" xml:space="preserve">
== {{int:filedesc}} == {{Information |Description=Map of [[Alberta]] with
cities, towns and roads |Source=GIS data |Date=2006-10 |Author={{User|Qyd}}
|Permission=All |other_versions=<gallery> Image:AB-towns-roads.png|without
town names Image:AB-towns-highways.png|simplified
Image:AB-cities-roads.png|cities and highways </gallery> }} [[Category:Maps
of Alberta]] [[Category:Locator maps of cities in Alberta|*]] ==
{{int:license}} == {{PD-self}}
</rev>
</revisions>
</page>
</pages>
</query>
<limits categories="500"/>
<continue continue="||categories|info|revisions" iistart="
2006-10-05T10:33:30Z"/>
</api>
I found there was a continue token at the end of the response, Then I use:
http://commons.wikimedia.org/w/api.php?action=query&format=xml&revids=37692…<http://commons.wikimedia.org/w/api.php?action=query&format=xml&revids=37692…>
to get the following response:
<api>
<limits categories="500"/>
<query>
<pages>
<page pageid="1246719" ns="6" title="File:AB towns+names.png"
imagerepository="local">
<imageinfo>
<ii size="76966" width="524" height="700"url="
http://upload.wikimedia.org/wikipedia/commons/archive/1/1d/20061006020043%2…
"descriptionurl="http://commons.wikimedia.org/wiki/File:AB_towns%2Bnames.png
" sha1="387284aaeea43dfae091e965e19cc47ce99dcf49"mime="image/png" bitdepth="
8"/>
</imageinfo>
</page>
</pages>
</query>
<continue continue="||categories|info|revisions" iistart="
2006-10-04T23:32:38Z"/>
</api>
I found in the response we didn't have the revisions information any more.
I think this may be a bug? Because I found if we set clcontinue to request
the following page, the response will not miss the revisions information.
P.S. Another question: Are the items in imageinfo list sorted by timestamp?
I mean from latest to oldest.
Thanks.
Hey, just wanted to share the fruits of some Mediawiki API work....
www.mapedia-uk.net
Try doing a search in the Historical types, such as British Prehistory or Roman Britain. Search for these in the UK and the locations you'll find there are Wikipedia articles that feature locations.
Still a WIP, with some teething problems in our system. But.. It does work :)
any feedback welcome,
Cheers
Chris Thomas - Managing Director
chris(a)mapedia-uk.net
-------- Original Message --------
Subject: [Wikitech-l] APIStrat conference, San Francisco, October 23, 24, 25
Date: Tue, 07 May 2013 14:33:40 -0700
From: Juliusz Gonera <jgonera(a)wikimedia.org>
Reply-To: Wikimedia developers <wikitech-l(a)lists.wikimedia.org>
To: Wikimedia developers <wikitech-l(a)lists.wikimedia.org>
A friend of mine is co-organizing a conference about APIs. She asked me
if there is someone from Wikimedia or the community who would be
interested in participating. It will take place in Parc 55 Hotel in San
Francisco on October 23, 24, 25. A bit of information about the conference:
> APIStrat is a vendor neutral conference, and we are committed to
> promote API usage/knowledge, and specifically with the event, to build
> a great program with interesting content and actually create something
> that is useful for the community. People behind it are Kin Lane
> (@apievangelist) and 3Scale. Here you can see speakers from the
> previous event: http://apistrategyconference.com/2013NYC/speakers.php,
> where they brought together over 350 people. Videos of the previous
> event can be found here: http://www.infoq.com/api-strategy-practice/
>
> This time we are expecting between 500-600 attendees, and it will be
> both service providers and API consumers (developers). The previous
> edition was mostly addressed to providers, but we will have an
> exclusive track addressed to developers in this edition.
They'd like us to:
- talk about how much traffic we deal with, how do we do it, who uses
our API (or something similar that we think would be of general interest),
- participate in the "APIs in Government - Towards a Data Commons" panel
giving the perspective of a non-profit (they aim to have federal, state,
education, international, and non-profit representation in this panel).
Seems interesting. Is there anyone who'd be interested in giving a talk
or participating in a panel there?
--
Juliusz
_______________________________________________
Wikitech-l mailing list
Wikitech-l(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l