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,
I reported these 2 bugs in the API, which have been fixed rapidly in the source code, but they are still not fixed on the server side (I just checked):
https://bugzilla.wikimedia.org/show_bug.cgi?id=23834https://bugzilla.wikimedia.org/show_bug.cgi?id=23835
Who do I contact to request the servers to use the new API with these fixes?
-Pierre
________________________________
Pierre-Olivier Latour
pol(a)cooliris.com
Hi,
I think that the API is returning bad results when I try to retrieve a
list of revisions.
Consider the following call to retrieve all revisions from the
Wikipedia article:
http://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=ids&rv…
The rvstartid and rvendid parameters are respectively set with the
latest revision made to the article and the first.
I know that this article has more than > 30000 revisions, however with
this call I am only getting 363 results.
Can anyone please check this ?
Thanks in advance,
--
Sérgio Nunes
I'm wondering why this
http://en.wikipedia.org/w/api.php?action=query&titles=Caffeine&meta=siteinf…
isn't working. Is there anything wrong with that request or is there something wrong with the API ?
The error code returned is
<error code="blinvalidtitle" info="Bad title ``''" xml:space="preserve">
thanks
-Ben
I finally had the time to dive back into this project and managed to get
everything working exactly as I was hoping.... locally! After uploading the
game to a server it suddenly stops working again. From my knowledge with
Flash games and further testing, I believe it has to do with the
cross-domain-policy for Wikitionary, which is usually an xml set up on the
server.
While attempting to locate the current Wikimedia policy I ran into random
comments with warnings about the security risks involved in using the
cross-domain-policy. I also discovered that Bugfix 1.9 states "Partial
support for Flash cross-domain-policy filtering."
I'm not sure where to go from here. Is there a confirmed and allowed method
to programmatically pull the rendered HTML from Wiktionary that can then be
parsed?
Thanks,
Aaron.
>
> On Sun, Apr 25, 2010 at 3:43 PM, Conrad Irwin <conrad.irwin(a)googlemail.com
> > wrote:
>
>>
>> On 04/25/2010 11:32 PM, Aaron Ward wrote:
>> > Hello there!
>> >
>> > I'm a Flash Video Game Developer working on a word based game. I
>> stumbled
>> > across the MediaWiki API component during my research and I've been
>> testing
>> > it locally in the game to retrieve word definitions and displaying them
>> in
>> > the game for the player. In general, everything works great locally, but
>> > there's a few odd issues that I'd like to get worked out, if possible.
>> >
>>
>> As in the forum, you can get definitions from Wiktionary, though it's
>> not quite that simple (there is not a "data" API to Wiktionary, you can
>> only get the page text).
>>
>> You have a choice between:
>>
>> 1. Getting the raw text of the page with the API and extracting the
>> lines that start with a # for definitions.
>> 2. Getting the rendered HTML of the page as normal, and extracting the
>> contents of the <ol> in <div id="bodyContent">.
>> 3. Creating something easier to use with the pre-extracted lists at
>> http://toolserver.org/~enwikt/definitions<http://toolserver.org/%7Eenwikt/definitions>
>> .
>>
>> In an ideal world there would be a public API using the data from (3),
>> but no one has done that yet.
>>
>> Conrad
>>
>
>
Hi,
I noted that MWclient uses, or tries to use, persistent HTTP
connections to the API.
I have a few questions, as I am looking at improving Interwicket,
which makes lots of API calls, and is sometimes driven nuts by the two
layers of proxies (here, on my side of the net) that are prone to
failing ...
Is using persistent connections a good idea?
What is the server-side timeout when a connection is idle?
Can I make requests to various different projects (xx.wiktionary, for
various xx) on the same connection (looks like it, as they all return
the same address)?
Just thinking about what would be best if I re-write a layer on my side (;-)
best,
Robert
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello,
There is only a read API for GlobalBlocking. While I look forward to not
resorting to screenscraping when a write API is implemented, I'm
proceeding with the interface available to me.
For the moment, I'm trying to figure out whether an IP has ever been
blocked. While this is trivial for single IPs, it isn't for rangeblocks.
The listing of *current* global blocks has the bgip parameter which
makes it very easy to check for blocks currently in effect, but there is
no such thing for the log. Any advice for proceeding from this point?
Thanks,
- -Mike
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
iEYEARECAAYFAkwNJQ8ACgkQst0AR/DaKHscHACeP/yHyY7udcfcRuREMadmQi/r
Z5UAoMWJ1LT5D2cEbTFhABnKT+hqMkby
=v2Oo
-----END PGP SIGNATURE-----
Hi,
I installed the MediaWiki::API (version 0.30) module from CPAN onto my
linux workstation. The wiki site that I wish to connect and modify is
running WikiMedia over https and I cannot get this simple login script
to work:
#!/usr/bin/perl
use strict;
use warnings;
use MediaWiki::API;
my $mw = MediaWiki::API->new();
sub on_error()
{
print "Error code: " . $mw->{error}->{code} . "\n";
print $mw->{error}->{stacktrace}."\n";
die;
}
$mw->{config}->{api_url} = 'https://wiki.eng.somecompany.com/index.php';
$mw->{config}->{on_error} = \&on_error;
# log in to the wiki
$mw->login( { lgname => 'myuser', lgpassword => 'mypass'} );
use Data::Dumper;
print Dumper($mw);
# perl wiki.pl
Error code: 2
401 Authorization Required : error occurred when accessing
https://wiki.eng.somecompany.com/index.php after 1 attempt(s) at
/usr/local/lib/perl5/site_perl/5.10.0/MediaWiki/API.pm line 354
MediaWiki::API::api('MediaWiki::API=HASH(0xce6e88)',
'HASH(0xf64ad0)') called at
/usr/local/lib/perl5/site_perl/5.10.0/MediaWiki/API.pm line 218
MediaWiki::API::login('MediaWiki::API=HASH(0xce6e88)',
'HASH(0xf64ad0)') called at wiki.pl line 19
Died at wiki.pl line 12.
>From the documentation, error code 2 stands for ERR_HTTP and I believe
this is due to attempting a connection over https.
Has anyone on the list had success with using the API (with
perl/python/java etc..) to login to wikis running https? Any pointers
to examples will be greatly helpful.
Thanks,
ravi
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello,
For CentralAuth, there is not even a read API. How would one best get
the current locked status/hidden status from the API (assuming one uses
an account with privileges sufficient for seeing accounts that are
hidden)? Currently, I'm thinking of looking at the most recent
globalauth log entry for that user to figure it out.
Thanks for your advice,
- -Mike
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
iEYEARECAAYFAkwNQLEACgkQst0AR/DaKHtB8wCffjzIPrscanVGlPsNyTyrJhu2
PZsAnid7XQx4CP6UyUOgHhLQsPYAyGFj
=vfQM
-----END PGP SIGNATURE-----