title: Search results different when using ws.spotify.com/search compared to desktop client
body: <p>On my future website I try to convert tracks given as a string "Artist - TrackTitle" into the corresponding "spotify:track:trackCode".</p>
  
  <p>Since I'm faster at programming PHP than javaScript (feel free to sneer), I do the following:</p>
  
  <ol>
  <li>Clear the string of a few things that a spotify search finds confusing, like things in brackets, symbols such as "`", "/", "-" etc.</li>
  <li>Convert spaces to the html entity "%20"</li>
  <li>retrieve the result of the spotify xml-page "<a href="http://ws.spotify.com/search/1/track?q=" rel="nofollow">http://ws.spotify.com/search/1/track?q=</a>" and the string attached.</li>
  <li>If there was a result, retrieve the FIRST match in that page that matches the regex "(spotify:track:)(.*)(\">)"</li>
  </ol>
  
  <p>Funnily, this works well for only about <strong>80% of all the strings</strong>. Although the strings are rather well standardized (they come from a radio website, the swedish "Digilistan P3"), some searches give 0 results.</p>
  
  <p>Possible solutions:</p>
  
  <ul>
  <li>A) The track is not available on spotify. </li>
  <li>B) The track IS available on spotify, but the search algorithm on ws.spotify.com/search differs from the desktop client.</li>
  <li>C) The search string is not well prepared for both the url version OR the desktop client</li>
  </ul>
  
  <p>Two tracks that fall into group B or C (after they are stripped from unsuitable characters):</p>
  
  <ol>
  <li>teddybears sthlm - rock´n´roll highschool</li>
  <li>bomfunk mc´s - b-boys &amp; flygirls</li>
  <li>christina aguilera, mya, pink &amp; lil´ kim - lady marmalade</li>
  <li>macklemore &amp; ryan lewis feat. wanz - thrift shop ( I mean: REALLY? Are you kidding me? Not even ws.spotify.com/search/1/track?q=macklemore%20&amp;thrift%20shop gives <strong><em>any</em></strong> result!)</li>
  </ol>
  
  <h1>Now the question</h1>
  
  <p>Can anyone suggest a better conversion or idea that improves my rating of success in finding suitable matches for the tracks?</p>
  
  <p>The current algorithm <a href="https://github.com/fridde/TopListGenerator/blob/master/digilistan/find_spotify_codes.php" rel="nofollow">can be found here</a>.</p>