diff options
author | Paul 'flowerysong' Arthur <flowerysong00@yahoo.com> | 2010-08-17 20:59:16 +0000 |
---|---|---|
committer | Paul 'flowerysong' Arthur <flowerysong00@yahoo.com> | 2010-08-17 20:59:16 +0000 |
commit | df80bd72432011010dc0e91ab564659ca6b2c500 (patch) | |
tree | c68f957da32a382bf3a542b7e7f3e54b886483ca /lib/class/artist.class.php | |
parent | 34d1449660437c2ea24dd55989efebf4e01d485f (diff) | |
download | ampache-df80bd72432011010dc0e91ab564659ca6b2c500.tar.gz ampache-df80bd72432011010dc0e91ab564659ca6b2c500.tar.bz2 ampache-df80bd72432011010dc0e91ab564659ca6b2c500.zip |
Refactored Last.FM recommendations; drop new dependency on curl since
Snoopy works just as well for this application.
Diffstat (limited to 'lib/class/artist.class.php')
-rw-r--r-- | lib/class/artist.class.php | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/lib/class/artist.class.php b/lib/class/artist.class.php index 1009591c..f7638b94 100644 --- a/lib/class/artist.class.php +++ b/lib/class/artist.class.php @@ -145,44 +145,6 @@ class Artist extends database_object { return $results; } // get_albums - public function get_like() { - - // Are you compiling with cURL? - if (!check_php_curl()) { - return false; - } - - $result = array(); - $lastfm_api_key = Config::get('lastfm_api_key'); - - $artistsql = "SELECT name FROM artist WHERE id = \"" . $this->id . "\""; - $artist_result = Dba::query($artistsql); - $r = Dba::fetch_assoc($artist_result); - $searchArtist = preg_replace('/ /', '%20', $r['name']); - - $lastsite = "http://ws.audioscrobbler.com/2.0/?method=artist.getsimilar&artist=" . $searchArtist . "&api_key=" . $lastfm_api_key; - debug_event('Similar', 'search url : ' . $lastsite, 5); - $lastch = curl_init(); - curl_setopt($lastch, CURLOPT_URL, $lastsite); - curl_setopt($lastch, CURLOPT_RETURNTRANSFER, 1); - - $lastxml = simplexml_load_string( curl_exec($lastch) ); - $lastcontent = curl_exec($lastch); - $lastxml = simplexml_load_string( $lastcontent ); - - foreach( $lastxml->similarartists->children() as $lastchild ) { - $check_query = 'SELECT * FROM artist WHERE name = \'' . $lastchild->name . '\''; - $check_result = Dba::query($check_query); - $row = Dba::fetch_assoc($check_result); - if( !is_null($row['id']) ) { - $result[] = $row['id']; - // debug_event('Similar', 'row return: ' . $row['id'], 5); - } - } - - return $result; - - } // get_like /** * get_songs |