<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Problem with get recently played tracks in Spotify for Developers</title>
    <link>https://community.spotify.com/t5/Spotify-for-Developers/Problem-with-get-recently-played-tracks/m-p/5385261#M4654</link>
    <description>&lt;P&gt;&lt;STRONG&gt;Plan&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Free&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Country&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Spain&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Device&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;(PC)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Operating System&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;(Ubuntu 20.04)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My Question or Issue&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I'm triyng to get the last played song using this code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="php"&gt;$ch3 = curl_init();
//Indicas el endpoint de la peticion
$endpoint = 'https://api.spotify.com/v1/me/player/recently-played?limit=2';
curl_setopt($ch3, CURLOPT_URL, $endpoint);
//Autorización y content type, estandar para utilizar access token
$authorization = "Authorization: Bearer " . $accesstoken;
curl_setopt($ch3, CURLOPT_HTTPHEADER, array('Content-Type: application/json', $authorization));
curl_setopt($ch3, CURLOPT_RETURNTRANSFER, 1);

//No se que hacen mucho pero funciona, si las quitas diria que no pasa nada
curl_setopt($ch3, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:x.x.x) Gecko/20041107 Firefox/x.x");
curl_setopt($ch3, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch3, CURLOPT_SSL_VERIFYPEER, false);

//Resultado de la peticion
$resultat = json_decode(curl_exec($ch3),true);
echo "&amp;lt;pre&amp;gt;";
var_dump($resultat);
echo "&amp;lt;/pre&amp;gt;";&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem i'm facing is that the result is getting old played songs&amp;nbsp; (4 or 5) days before. Is this a known issue ? How can i get the name of the really latest played song? Also to be included in the list of recently played songs do i have to listen all the song or only some seconds?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be apreciated&lt;/P&gt;&lt;P&gt;Thanks in advance&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 23 May 2022 08:41:06 GMT</pubDate>
    <dc:creator>gtalmaciu98</dc:creator>
    <dc:date>2022-05-23T08:41:06Z</dc:date>
    <item>
      <title>Problem with get recently played tracks</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Problem-with-get-recently-played-tracks/m-p/5385261#M4654</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Plan&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Free&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Country&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Spain&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Device&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;(PC)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Operating System&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;(Ubuntu 20.04)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My Question or Issue&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I'm triyng to get the last played song using this code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="php"&gt;$ch3 = curl_init();
//Indicas el endpoint de la peticion
$endpoint = 'https://api.spotify.com/v1/me/player/recently-played?limit=2';
curl_setopt($ch3, CURLOPT_URL, $endpoint);
//Autorización y content type, estandar para utilizar access token
$authorization = "Authorization: Bearer " . $accesstoken;
curl_setopt($ch3, CURLOPT_HTTPHEADER, array('Content-Type: application/json', $authorization));
curl_setopt($ch3, CURLOPT_RETURNTRANSFER, 1);

//No se que hacen mucho pero funciona, si las quitas diria que no pasa nada
curl_setopt($ch3, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:x.x.x) Gecko/20041107 Firefox/x.x");
curl_setopt($ch3, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch3, CURLOPT_SSL_VERIFYPEER, false);

//Resultado de la peticion
$resultat = json_decode(curl_exec($ch3),true);
echo "&amp;lt;pre&amp;gt;";
var_dump($resultat);
echo "&amp;lt;/pre&amp;gt;";&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem i'm facing is that the result is getting old played songs&amp;nbsp; (4 or 5) days before. Is this a known issue ? How can i get the name of the really latest played song? Also to be included in the list of recently played songs do i have to listen all the song or only some seconds?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be apreciated&lt;/P&gt;&lt;P&gt;Thanks in advance&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2022 08:41:06 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Problem-with-get-recently-played-tracks/m-p/5385261#M4654</guid>
      <dc:creator>gtalmaciu98</dc:creator>
      <dc:date>2022-05-23T08:41:06Z</dc:date>
    </item>
  </channel>
</rss>

