mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Add commons API query as comment
This commit is contained in:
parent
49ee084c31
commit
9b2b3c7861
2 changed files with 4 additions and 3 deletions
|
|
@ -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")
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue