47 lines
1.2 KiB
Java
47 lines
1.2 KiB
Java
package org.sillyjirafe.uoapi;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
import org.sillyjirafe.uoapi.binds.*;
|
|
|
|
public class Out {
|
|
List<Api> Apis = new ArrayList<>();
|
|
|
|
public List<String> PreOut()
|
|
{
|
|
Apis.add(new GitHubMITApi());
|
|
Apis.add(new GitHubLGPLApi());
|
|
Apis.add(new GitHubApacheApi());
|
|
Apis.add(new OpenVerseImagesApi());
|
|
Apis.add(new OpenVerseAudiosApi());
|
|
Apis.add(new PixabayImagesApi());
|
|
|
|
List<String> bindnames = new ArrayList<>();
|
|
|
|
for (Api api : Apis)
|
|
{
|
|
bindnames.add(api.getName());
|
|
}
|
|
|
|
return bindnames;
|
|
}
|
|
|
|
public List<element> out(Map<String, Integer> bindpages, Map<String, String> ApiKeys) throws Exception
|
|
{
|
|
List<element> Elements = new ArrayList<>();
|
|
|
|
for (int i = 0; i < Apis.size(); i++)
|
|
{
|
|
List<element> currentapi = Caller.CallApi(Apis.get(i), bindpages.get(Apis.get(i).getName()), ApiKeys.get(Apis.get(i).getName()));
|
|
for (int j = 0; j < currentapi.size(); j++)
|
|
{
|
|
Elements.add(currentapi.get(j));
|
|
}
|
|
}
|
|
return Elements;
|
|
}
|
|
}
|