diff --git a/bridges/DerpibooruBridge.php b/bridges/DerpibooruBridge.php index 995e0cc1..0ad37dd1 100644 --- a/bridges/DerpibooruBridge.php +++ b/bridges/DerpibooruBridge.php @@ -2,7 +2,7 @@ class DerpibooruBridge extends BridgeAbstract { const NAME = 'Derpibooru Bridge'; const URI = 'https://derpibooru.org/'; - const DESCRIPTION = 'Returns newest posts from a Derpibooru search'; + const DESCRIPTION = 'Returns newest images from a Derpibooru search'; const CACHE_TIMEOUT = 300; // 5min const MAINTAINER = 'Roliga'; @@ -73,13 +73,13 @@ class DerpibooruBridge extends BridgeAbstract { public function collectData(){ $queryJson = json_decode(getContents( self::URI - . 'search.json?filter_id=' + . 'api/v1/json/search/images?filter_id=' . urlencode($this->getInput('f')) . '&q=' . urlencode($this->getInput('q')) )) or returnServerError('Failed to query Derpibooru'); - foreach($queryJson->search as $post) { + foreach($queryJson->images as $post) { $item = array(); $postUri = self::URI . $post->id; @@ -88,25 +88,27 @@ class DerpibooruBridge extends BridgeAbstract { $item['title'] = $post->id; $item['timestamp'] = strtotime($post->created_at); $item['author'] = $post->uploader; - $item['enclosures'] = array('https:' . $post->image); - $item['categories'] = explode(', ', $post->tags); + $item['enclosures'] = array($post->view_url); + $item['categories'] = $post->tags; $item['content'] = '
' // description . $post->description . '
Size: ' // image size
. $post->width
. 'x'
- . $post->height
- . '
Source: source_url
. '">'
. $post->source_url
. '