Example Code not working: Helper classes for the MediaWiki api.php. - Example - Get all interlanguage links #19
Unanswered
hannahceline
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I copied the code of the example: Helper classes for the MediaWiki api.php. - Example - Get all interlanguage links. However, the method queryXML is not working anymore. Instead, I tried to use the method query and created a query and set query = query.prop("langlinks") and query = query.titles("England"). However, the result of the connector doesn't show the langlinks. For other properties, like "links" instead of "langlinks" it works. Does someone know what I'm missing?
This is my code:
Query query1 = new Query();
query1= query1.prop("langlinks");
query1 = query1.titles("England");
User user1 = new User("", "", "https://en.wikipedia.org/w/api.php");
user1.login();
Connector connector1 = new Connector();
List pageInfo1 = connector1.query(user1, query1);
if (pageInfo1 == null) {
System.out.println("Got no Page Info result for the query");
}
System.out.println(pageInfo1);
Beta Was this translation helpful? Give feedback.
All reactions