src/lastfmapi/Api/TagApi.php
public function getSimilar($methodVars)
    {
        // Check for required variables
        if (!empty($methodVars['tag'])) {
            $vars = array(
                'method' => 'tag.getsimilar',
                'api_key' => $this->auth->apiKey
            );
            $vars = array_merge($vars, $methodVars);
            $similar = array();
            if ($call = $this->apiGetCall($vars)) {
                $i = 0;
                foreach ($call->similartags->tag as $tag) {
                    $similar[$i]['name'] = (string) $tag->name;
                    $similar[$i]['url'] = (string) $tag->url;
                    $similar[$i]['streamable'] = (string) $tag->streamable;
                    $i++;
                }
                return $similar;
            } else {
                return false;
            }
        } else {
            throw new InvalidArgumentException('You must include tag variable in the call for this method');
        }
    }
public function getSimilar($methodVars)
    {
        // Check for required variables
        if (!empty($methodVars['tag'])) {
            $vars = array(
                'method' => 'tag.getsimilar',
                'api_key' => $this->auth->apiKey
            );
            $vars = array_merge($vars, $methodVars);
            $similar = array();
            if ($call = $this->apiGetCall($vars)) {
                $i = 0;
                foreach ($call->similartags->tag as $tag) {
                    $similar[$i]['name'] = (string) $tag->name;
                    $similar[$i]['url'] = (string) $tag->url;
                    $similar[$i]['streamable'] = (string) $tag->streamable;
                    $i++;
                }
                return $similar;
            } else {
                return false;
            }
        } else {
            throw new InvalidArgumentException('You must include tag variable in the call for this method');
        }
    }
public function getSimilar ( $ methodVars ) { // Check for required variables if ( ! empty ( $ methodVars [ 'tag' ] ) ) { $ vars = array ( 'method' => 'tag.getsimilar' , 'api_key' => $ this -> auth -> apiKey ) ; $ vars = array_merge ( $ vars , $ methodVars ) ; $ similar = array ( ) ; if ( $ call = $ this -> apiGetCall ( $ vars ) ) { $ i = 0 ; foreach ( $ call -> similartags -> tag as $ tag ) { $ similar [ $ i ] [ 'name' ] = ( string ) $ tag -> name ; $ similar [ $ i ] [ 'url' ] = ( string ) $ tag -> url ; $ similar [ $ i ] [ 'streamable' ] = ( string ) $ tag -> streamable ; $ i ++ ; } return $ similar ; } else { return false ; } } else { throw new InvalidArgumentException ( 'You must include tag variable in the call for this method' ) ; } }
Search for tags similar to this one. Returns tags ranked by similarity, based on listening data
@param array $methodVars An array with the following required values: <i>tag</i>
@return array
Search for tags similar to this one . Returns tags ranked by similarity based on listening data