Last.fm Web Services » Diskussionen

No suitable way to get all tracks (along with dates)

 
    • kurtrips schrieb...
    • Benutzer
    • 27. Dez. 2008, 20:09

    No suitable way to get all tracks (along with dates)

    For getting all tracks played (along with dates), I tried
    1) get the weekly chart lists (but this ends at the last week)
    2) get the recent tracks (but this is limited to only 100)

    So there seems to be no way of getting the songs between the end of last week and the latest 100 songs played.

    i tried library.getTracks too but there are no dates there.

    My suggestion: make user.getRecentTracks return all tracks till the end of last week.

    I can parse the user's pages itself for this but I'd rather not do that because admins might not like that. :-)

    Random Song Statistics and Song Recommendation Tool - http://lastfm.heathaze.org/
  • Yeah, I'd like to second this request. Another option might be adding an offset parameter. For example: http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=rj&offset=100&limit=100

    • tburny schrieb...
    • Forum Moderator
    • 3. Jan. 2009, 13:09
    library.getTracks might be suitable, too, but it contains no dates

    Combo.fm: Combine your favourite radio stations! | My Blog | scala-lastfmapi
    P.S.: Do not click here
    throw new PokemonException(); //Gotta catch 'em all
    My forum post reflects my personal opinion :)
    • kurtrips schrieb...
    • Benutzer
    • 8. Jan. 2009, 17:26

    More problems with getting all tracks

    Seems like the getweeklytrackchart itself does not return all the tracks scrobbled for the week.

    Take a look at this page http://www.last.fm/user/Egg21/tracks?page=322 and search for 'Behind Blue Eyes'. You'll notice 1 track scrobbled on 15th Dec 2007.

    But when I try this, it does not return the above mentioned track. The date range is from 9-Dec-2007 to 16-Dec-2007
    http://ws.audioscrobbler.com/2.0/?method=user.getweeklytrackchart&user=Egg21&from=1197201600&to=1197806400&api_key=b25b959554ed76058ac220b7b2e0a026

    I also tried the following url in case the issue was because of time gap between countries, but still no match. The dates for the following range is 16-Dec-2007 to 23-Dec-2007.
    http://ws.audioscrobbler.com/2.0/?method=user.getweeklytrackchart&user=Egg21&from=1197806400&to=1198411200&api_key=b25b959554ed76058ac220b7b2e0a026

    If I'm wrong somewhere please do let me know, but it seems to me that getweeklytrackchart has some limit for the maximum number of records returned. If this is so, then please mention this on the API doc page for this method and make it return data in paged format.

    Random Song Statistics and Song Recommendation Tool - http://lastfm.heathaze.org/
    • Egg21 schrieb...
    • Benutzer
    • 9. Jan. 2009, 8:56
    but it seems to me that getweeklytrackchart has some limit for the maximum number of records returned. I think so. Both the calls you quote returns exactly 1000 tracks. Hardly a coincidence.

    It think the most reliable way to get everything would be to strip the tracks from http://www.last.fm/user/user/tracks?page=xxx
    Or get the last.fm staff to set the limit at no less than 10,000 tracks if they need a limit (there are 10,080 minutes in a week). On the other hand, extremely rare iPod updates could generate more activity than that or people starting their account by importing listening history from elsewhere.

    Recommended Games: [Game] Music Knowledge Challenge and Obscure Music Game.
    If you want to find new bands then try joining under 2000 listeners
    • m0nkiii schrieb...
    • Benutzer
    • 9. Jan. 2009, 22:43

    Re: No suitable way to get all tracks (along with dates)

    kurtrips
    I can parse the user's pages itself for this but I'd rather not do that because admins might not like that. :-)


    I don't think they mind if you parse the site ;)
    Like you know, I'm a parser :)

    But I'd like support in the API instead too. Would be nice.

    • kurtrips schrieb...
    • Benutzer
    • 10. Jan. 2009, 2:34
    Parsing the page seems to be the only way of getting all tracks.
    However I don't think this is reliable at all because it is slightly dependent on the user-interface unlike the web service which is tied totally to the database, which means that a small change to the design of the web page (like the recent neighbors page change) can cause my application to fail.
    Another issue is that parsing the web pages would involve much more web requests than parsing the weekly data. (For ex. 60 weeks vs. 391 pages for Egg21)

    So, I hope some admin can take some sort of a call on the getuserweeklytrackchart method or even just inform me if no action is going to be taken on it.

    Random Song Statistics and Song Recommendation Tool - http://lastfm.heathaze.org/
    • TripleF schrieb...
    • Abonnent
    • 19. Mär. 2009, 15:15

    Re: No suitable way to get all tracks (along with dates)

    I'd like to second the request of adding a method to the API to get all track data along with dates. A whole category of possible applications (i.e. ones based on listening histories) is only possible with this kind of data available.

    Thanks!

    • Gredunza schrieb...
    • Benutzer
    • 23. Mär. 2009, 14:47
    As far as I can tell, parsing all user pages sequentially is the only way to get all user tracks. Offhand, as long as you sleep for a few seconds between GETs, I don't see why anybody would mind this being done as it'll be identical to a user clicking 'next' repeatedly. But failing to do so would make it somewhat similar to a DoS attack.
    And it'll still take a while for a large amount of tracks.

    I wrote some Perl to do this, though it only fetches artist and track name; not dates.

    Personally, I don't see why the API couldn't support the OFFSET clause; but I profess to know nothing of how the SQL backend is set up.

    • cyclops79 schrieb...
    • Benutzer
    • 25. Mär. 2009, 3:12
    People have complained about this in the past (1, 2), but I get the impression that the staff just chooses to ignore this request.

    : /

    • TripleF schrieb...
    • Abonnent
    • 30. Mär. 2009, 21:02
    cyclops79 said:
    People have complained about this in the past (1, 2), but I get the impression that the staff just chooses to ignore this request.
    Yes, that's what it seems like. It would be nice to get an official statement on this though, since the reason for leaving this functionality out is not quite obvious.

    • TripleF schrieb...
    • Abonnent
    • 4. Mai. 2009, 9:59

    Vote on LastFVS

    Vote for this feature on LastFVS: http://lastfvs.matto1990.com/idea/17/

    • Bor81 schrieb...
    • Benutzer
    • 2. Jun. 2009, 8:43
    any progress ?

    ...chime forever...
    http://bor.org.ua
  • I set up this and am wondering if there's any way for me to improve the accuracy (ie, go past 100 tracks) just using what's currently available. I think there isn't, so do I need something like this to be implemented?

  • hola me gustaria dar una sugerencia en mi lista de reproduccion por mes aparen canciones y/o artistas que yo he borrado me podrian ayudar con eso para tener mis estadisticas bien gracias

  • If only there was a user.getArtistTracks that has an optional "artist" parameter

    But I wonder if they're doing it intentionally so that we can't just move our data off the site.



  • Ah looks like user.getrecenttracks does it now



    • lasturtl schrieb...
    • Benutzer
    • 13. Mär. 2011, 17:54
    I'd like to add my vote to this request!

    • marc2003 schrieb...
    • Benutzer
    • 13. Mär. 2011, 23:59
    the answer is in the post above yours. you can parse your entire listening history using user.getrecentttracks (with pagination). so long as you don't break the TOS you agreed to when applying for your API key, it shouldn't be a problem (other than the long wait it will take for your script/program to complete :P)

Anonyme Benutzer dürfen keine Beiträge schreiben. Bitte log dich ein oder registriere dich, um Beiträge in den Foren schreiben zu können.