Skip to content

Commit

Permalink
[WorldCosplayBridge] fix Cosplayer API response structure (#2307)
Browse files Browse the repository at this point in the history
  • Loading branch information
fmachen authored Mar 24, 2022
1 parent 9cd8e93 commit 297a6cf
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions bridges/WorldCosplayBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,15 @@ public function collectData() {
$list = $json->list;

foreach($list as $img) {
$item = array();
$item['uri'] = self::URI . substr($img->photo->url, 1);
$item['title'] = $img->photo->subject;
$item['timestamp'] = $img->photo->created_at;
$item['author'] = $img->member->global_name;
$item['enclosures'] = array($img->photo->large_url);
$item['uid'] = $img->photo->id;
$image = isset($img->photo) ? $img->photo : $img;
$item = array(
'uri' => self::URI . substr($image->url, 1),
'title' => $image->subject,
'timestamp' => $image->created_at,
'author' => $img->member->global_name,
'enclosures' => array($image->large_url),
'uid' => $image->id,
);
$item['content'] = sprintf(
self::CONTENT_HTML,
$item['uri'],
Expand Down

0 comments on commit 297a6cf

Please sign in to comment.