title: Retrieving Soundcloud media URL via PHP CURL?
body: <p>I'm using the Soundcloud API + PHP to pull information about soundcloud tracks in order to use jPlayer as a mp3 player for playlists. Now, I am able to completely access all the information about the track except the actual link to the mp3, in order to play the track. </p>
  
  <p>According to the API, if the track allows streaming, you just have to cURL the stream URL (ie: <a href="http://api.soundcloud.com/tracks/24887826/stream?client_id=xxx" rel="nofollow">http://api.soundcloud.com/tracks/24887826/stream?client_id=xxx</a>). </p>
  
  <p>Now, If I try to cURL that, my results are a simple  HTML bit <code>&lt;html&gt;&lt;body&gt;You are being &lt;a href="http://ak-media.soundcloud.com/sjkn57c6gAA5.128.mp3?AWSAccessKeyId=AKIAJBHW5FB4ERKUQUOQ&amp;amp;Expires=1318411541&amp;amp;Signature=yaX7Noe%2F8c5dFF0H%2BGfhZ%2FX0130%3D&amp;amp;__gda__=1318411541_6ed9d2af39e51b5f1e94e659eff0495d"&gt;redirected&lt;/a&gt;.&lt;/body&gt;&lt;/html&gt;</code>. </p>
  
  <p>The link I want is the whole <code>media.soundcloud.com/sjkn57c6gAA5</code> and that's it. However, if I try to xpath the <code>'//a/@href'</code> I get no results returned. Can anyone point me in to the right direction of how to grab this link so I can generate the appropriate link to the file?</p>
  
  <p>Thanks ahead of time!</p>
  
  <p>Tre</p>