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 guys,
When I do a query for categories using the API I would only like to get the
categories that are listed in the wiki page. For example when I query the
Brocoli page, I get this:
<categories>
<cl ns="14" title="Category:All articles with unsourced statements"/>
<cl ns="14" title="Category:Articles containing Italian-language text"/>
<cl ns="14" title="Category:Articles with 'species' microformats"/>
<cl ns="14" title="Category:Articles with unsourced statements from January
2013"/>
<cl ns="14" title="Category:Brassica oleracea"/>
<cl ns="14" title="Category:Commons category with local link same as on
Wikidata"/>
<cl ns="14" title="Category:Cultivars"/>
<cl ns="14" title="Category:Edible plants"/>
<cl ns="14" title="Category:Inflorescence vegetables"/>
<cl ns="14" title="Category:Pages with citations having bare URLs"/>
</categories>
But I am only interested in these (You'll see it at the bottom of this page
http://en.wikipedia.org/wiki/Brocoli):
<cl ns="14" title="Category:Brassica oleracea"/>
<cl ns="14" title="Category:Cultivars"/>
<cl ns="14" title="Category:Edible plants"/>
<cl ns="14" title="Category:Inflorescence vegetables"/>
I was wondering if there is any workaround this?
Thanks
Chux
Hello list,
after I can successfully edit pages via API function I want to send
text content with pipe characters.
It works as long this characters is not at the beginning of a line.
(but most formulars work in that way)
Leading pipe " | " sign is ignored.
My script looks like:
content="content|pipe|content
|newline
|newline"
wget ..... --post-data "action=edit&title=pagename&text=$content&token=
The result looks like:
content|pile|content
newline
newline
Can anybody help me how to quote it?
Thanks
Andreas
Hello list,
I've read many posts around this error but I cannot figure out why I did
not get it.
I hope you can shine a light to it, please.
My system: MW 1.21.1
I use AUTH_REMOTEUSER modul and its working fine.
It seems that it works with the api.php too. (fetching info with my user
rights)
Well, referring to http://en.wikipedia.org/w/api.php
I want to do the action=edit to create or edit pages.
So I start to fetch my login token.
wget --http-user=myuser --http-password=mypwd "
https://localhost/wiki/api.php?action=query&prop=info|revisions&intoken=edi…
then I get the xml back
... <page ns="0" title="mynewpage" missing=""
starttimestamp="2013-09-26T21:38:59Z"
edittoken="396fb7fbd9a308620d460e92e611d100+\" /></pages> ...
So I extract this edittoken-element and simply create a new page.
($newtoken=edittoken)
wget --http-user=myuser --http-password=mypwd --header="Content-Type:
application/x-www-form-urlencoded" "https://localhost/wiki/api.php"
--post-data "action=edit&title=mynewpage&text=test&token=$newtoken"
I get back:
error code="badtoken" info="Invalid token"
After investigation I found a webpage
https://www.mediawiki.org/wiki/API:Edit
which describes the token characters (The token that you received is
terminated with +\, this needs to be urlencoded (so it will end with %2B%5C)
before it is passed back)
I tried it with this hint and without it.... but with no success....
I also tried to do a normal login (action=login) but it does not help.
For information... my user does not have any password because of active
directory authentication by the webserver. So I can not add the parameter
lgname=myuser&lgpassword ....
Please can you help me?
Thank you very much!
Andreas
Hello all,
I've gathered a lot of data regarding article views for a select number of articles of interest on the English language Wikipedia. I am interesting in finding out if there is a way to collect this data only for articles that were viewed in a specific country (i.e. the United States). Is this possible to do? I would also be interested in doing the same thing for article edits as well.
Thanks very much,
David McIver
Boston Children's Hospital
Harvard Medical School
---------- Forwarded message ----------
Date: Tue, 10 Sep 2013 12:11:56 +0200
From: Daniel Kinzler <daniel.kinzler(a)wikimedia.de>
Hi all.
With today's deployment, the Wikibase API modules used on wikidata.org
will change from using lower-case IDs (q12345) to upper-case IDs
(Q12345). This is done for consistency with the way IDs are shown in
the UI and used in URLs.
The API will continue to accept entity IDs in lower-case as well as
upper-case. Any bot or other client that has no property or item IDs
hardcoded or configured in lower case should be fine.
If however your code looks for some specific item or property in the
output returned from the API, and it's using a lower-case ID to do so,
it may now fail to match the respective ID.
There is potential for similar problems with Lua code, depending on
how the data structure is processed by Lua. We are working to minimize
the impact there.
Sorry for the short notice.
Please test your code against test.wikidata.org and let us know if you
find any issues.
Thanks,
Daniel
PS: issue report on bugzilla:
https://bugzilla.wikimedia.org/show_bug.cgi?id=53894
_______________________________________________
Mediawiki-api-announce mailing list
Mediawiki-api-announce(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce
Hi all,
Currently I create a mediawiki website.
For the API request, I want to add some limit such as 1000 per day per
developer,etc.
I find 3scale provides this service, but I have some problems to deploy it.
Do I really need 3rd-party service to add limit to mediawiki?
If so, how can I change the API url, for me, I want to change it from
example.com/w/api.php to api.example.com
Thanks
Best,
John