Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8498185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:19:57+00:00 2026-06-11T00:19:57+00:00

Using the user.getRecentTracks, Last.fm sends 2 tracks despite the limit I set was 1.

  • 0

Using the user.getRecentTracks, Last.fm sends 2 tracks despite the limit I set was 1. Due to some wise guy, it only sends one track if I am not currently listening to a track.

For example: http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=yeppaul&api_key=b25b959554ed76058ac220b7b2e0a026&limit=1

<lfm status="ok">
<recenttracks user="yeppaul" page="1" perPage="1" totalPages="1474" total="1474">
<track nowplaying="true">
<artist>
<name>The Offspring</name>
<mbid>23a03e33-a603-404e-bcbf-2c00159d7067</mbid>
<url>The Offspring</url>
<image size="small">http://userserve-ak.last.fm/serve/34/319822.jpg</image>
<image size="medium">http://userserve-ak.last.fm/serve/64/319822.jpg</image>
<image size="large">http://userserve-ak.last.fm/serve/126/319822.jpg</image>
<image size="extralarge">http://userserve-ak.last.fm/serve/252/319822.jpg</image>
</artist>
<loved>0</loved>
<name>Original Prankster</name>
<streamable>1</streamable>
<mbid>07933833-f6df-45eb-80ab-870e1d19b151</mbid>
<album mbid="05a93768-e317-338a-882e-fbe83790d8cd">Conspiracy of One</album>
<url>
http://www.last.fm/music/The+Offspring/_/Original+Prankster
</url>
<image size="small">http://userserve-ak.last.fm/serve/34s/47828469.png</image>
<image size="medium">http://userserve-ak.last.fm/serve/64s/47828469.png</image>
<image size="large">http://userserve-ak.last.fm/serve/126/47828469.png</image>
<image size="extralarge">
http://userserve-ak.last.fm/serve/300x300/47828469.png
</image>
</track>
<track>
<artist>
<name>The Offspring</name>
<mbid>23a03e33-a603-404e-bcbf-2c00159d7067</mbid>
<url>The Offspring</url>
<image size="small">http://userserve-ak.last.fm/serve/34/319822.jpg</image>
<image size="medium">http://userserve-ak.last.fm/serve/64/319822.jpg</image>
<image size="large">http://userserve-ak.last.fm/serve/126/319822.jpg</image>
<image size="extralarge">http://userserve-ak.last.fm/serve/252/319822.jpg</image>
</artist>
<loved>0</loved>
<name>Smash</name>
<streamable>0</streamable>
<mbid>1c6f6ba6-ea2e-4dcf-bef5-20f29d70611d</mbid>
<album mbid="021b8436-4c5f-3aa0-ac08-3ebf6470ada3">Smash</album>
<url>http://www.last.fm/music/The+Offspring/_/Smash</url>
<image size="small">http://userserve-ak.last.fm/serve/34s/60481175.jpg</image>
<image size="medium">http://userserve-ak.last.fm/serve/64s/60481175.jpg</image>
<image size="large">http://userserve-ak.last.fm/serve/126/60481175.jpg</image>
<image size="extralarge">
http://userserve-ak.last.fm/serve/300x300/60481175.jpg
</image>
<date uts="1347066244">8 Sep 2012, 01:04</date>
</track>
</recenttracks>
</lfm>

Here’s my jQuery:

$(document).ready(function(){ 
    $.ajax({
        type: "GET",
        url: "http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=yeppaul&api_key=61d9a12fccfc085e5ddc70beccdbeaae&limit=5",
        dataType: "xml",
        success: showListens
    });
});

function showListens(xml) {
    $(xml).find("track").each(function()
    {
        $(".listen").append("<a href=" + $(this).find("url").text() + ">" + $(this).find("artist").text() + " &mdash; " + $(this).find("name").text() + "</a><br /><br />");    
    });
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T00:20:00+00:00Added an answer on June 11, 2026 at 12:20 am

    Since the track that is being listened is marked with the attribute nowplaying="true", you can filter these tracks using not([nowplaying]):

    $(xml).find("track:not([nowplaying])").each(function()...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm retrieving some records from a database using user = Users.all in the console
I'm trying to do some calculations within a SELECT query, using user variables to
My windows application using user control and one dll is loaded on 4 pc.
I am using user controls to display some content on a asp.net page.And I
I'm experiencing some interesting behaviour with using user-defined functions within a SELECT statement. I
I'm currently using: @user = User.find(params[:id]) @posts = Post.find(:all, :conditions => [user_id = ?,
How to detect apple computers using user-agent ? Safari may be run in windows
I am trying to create a trapezoid using user inputted options. I know my
using fconnect user have authenticated and i have saved their userid to my database.
When user using the Settings' Clear Data button I get the following message: ActivityManager(201):

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.