3     Pitchfork Music Player Daemon Client
 
   4     Copyright (C) 2007  Roger Bystrøm
 
   6     This program is free software; you can redistribute it and/or modify
 
   7     it under the terms of the GNU General Public License as published by
 
   8     the Free Software Foundation; version 2 of the License.
 
  10     This program is distributed in the hope that it will be useful,
 
  11     but WITHOUT ANY WARRANTY; without even the implied warranty of
 
  12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
  13     GNU General Public License for more details.
 
  15     You should have received a copy of the GNU General Public License along
 
  16     with this program; if not, write to the Free Software Foundation, Inc.,
 
  17     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
  20         function strands_send_request($url) {
 
  21                 $STRANDS_URL = "https://www.mystrands.com/services";
 
  23                 $url = $STRANDS_URL . $url . "&subscriberId=5a05bc1dd3d608e96c8d336daf3544c5";
 
  24                 $xml = @file_get_contents($url);
 
  25                 $xml = @simplexml_load_string($xml);
 
  30          * artists must be an array
 
  32         function strands_get_recommendations($artists) {
 
  34                 foreach($artists as $a) 
 
  35                         $url .= "&name=" . urlencode($a);
 
  36                 $url = "/recommend/artists?" . $url;
 
  38                 $res = strands_send_request($url);
 
  44                 if(!$res->SimpleArtist) return $ret;
 
  46                 foreach($res->SimpleArtist as $sa) {
 
  48                                 $ret[] = (string)$sa->ArtistName;