Add commons API query as comment

This commit is contained in:
misaochan 2016-12-14 16:27:15 +13:00
parent 49ee084c31
commit 9b2b3c7861
2 changed files with 4 additions and 3 deletions

View file

@ -35,10 +35,11 @@ public class ExistingFileAsync extends AsyncTask<Void, Void, ArrayList<String>>
MWApi api = CommonsApplication.createMWApi();
ApiResult result;
ArrayList<String> items = new ArrayList<>();
//URL https://commons.wikimedia.org/w/api.php?action=query&format=xml&list=search&srwhat=text&srenablerewrites=1&srnamespace=14&srlimit=10&srsearch=
// https://commons.wikimedia.org/w/api.php?action=query&list=allimages&aisha1=801957214aba50cb63bb6eb1b0effa50188900ba
try {
result = api.action("query")
.param("format", "xml")

View file

@ -249,7 +249,7 @@ public class ShareActivity
String fileSHA1 = Utils.getSHA1(inputStream);
//FIXME: Replace hardcoded string with call to Commons API instead (use TitleCategories.java as template)
// https://commons.wikimedia.org/w/api.php?action=query&list=allimages&aisha1=801957214aba50cb63bb6eb1b0effa50188900ba
ExistingFileAsync fileAsyncTask = new ExistingFileAsync(fileSHA1);
fileAsyncTask.execute(url1, url2, url3);