Skip to content

Commit

Permalink
[SoundCloudBridge] Use account avatar as feed icon (RSS-Bridge#1146)
Browse files Browse the repository at this point in the history
  • Loading branch information
VerifiedJoseph authored and logmanoriginal committed Jun 1, 2019
1 parent 6c68fba commit 21e4dd9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions bridges/SoundcloudBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ class SoundCloudBridge extends BridgeAbstract {

const CLIENT_ID = 'W0KEWWILAjDiRH89X0jpwzuq6rbSK08R';

private $feedIcon = null;

public function collectData(){

$res = json_decode(getContents(
Expand All @@ -25,6 +27,8 @@ public function collectData(){
. self::CLIENT_ID
)) or returnServerError('No results for this query');

$this->feedIcon = $res->avatar_url;

$tracks = json_decode(getContents(
'https://api.soundcloud.com/users/'
. urlencode($res->id)
Expand Down Expand Up @@ -56,6 +60,14 @@ public function collectData(){

}

public function getIcon(){
if ($this->feedIcon) {
return $this->feedIcon;
}

return parent::getIcon();
}

public function getName(){
if(!is_null($this->getInput('u'))) {
return self::NAME . ' - ' . $this->getInput('u');
Expand Down

0 comments on commit 21e4dd9

Please sign in to comment.