[update] PixabayStorage
This commit is contained in:
@@ -11,6 +11,28 @@ typedef PixabayResponse = {
|
||||
}>
|
||||
}
|
||||
|
||||
enum PixabayCategory {
|
||||
FASHION;
|
||||
NATURE;
|
||||
BACKGROUNDS;
|
||||
SCIENCE;
|
||||
EDUCATION;
|
||||
PEOPLE;
|
||||
FEELINGS;
|
||||
RELIGION;
|
||||
HEALTH;
|
||||
PLACES;
|
||||
ANIMALS;
|
||||
INDUSTRY;
|
||||
FOOD;
|
||||
COMPUTER;
|
||||
SPORTS;
|
||||
TRANSPORTATION;
|
||||
TRAVEL; BUILDINGS;
|
||||
BUSINESS;
|
||||
MUSIC;
|
||||
}
|
||||
|
||||
@:provide class PixabayStorage extends SharedObjectStorage implements ISourceStorage {
|
||||
|
||||
private var key:String;
|
||||
@@ -26,7 +48,7 @@ typedef PixabayResponse = {
|
||||
return enabled && exists(type) ?
|
||||
Promise.promise(read(type)) :
|
||||
new JsonLoader<PixabayResponse>()
|
||||
.GET('https://pixabay.com/api/?key=${key}&category=${type}')
|
||||
.GET('https://pixabay.com/api/?key=${key}&q=${type}')
|
||||
.then(function(result:PixabayResponse) {
|
||||
var result = [for (item in result.hits) URL(item.largeImageURL)];
|
||||
if (enabled) {
|
||||
|
||||
Reference in New Issue
Block a user