Forum » Development Discussion

Anniversary (Milestone) tracks grabber

 
  • Anniversary (Milestone) tracks grabber

    Hey, I've done a script that identifies anniversary tracks (1000th, 2000th etc.).

    enjoy it here.

    News
    - 09 mar 2009 - script (SUDDENLY!) approached from closed beta
    - 30 mar 2009 - added alt.offset option
    - 12 apr 2009 - timestamp bug fix
    - 15 apr 2009 - page will load a bit faster due to caching data :)
    bonus: small sweet addition - it remembers your username
    - 27 apr 2009 - optional artist/title links
    - 10 may 2009 - added russian language (it will be detected automatically if you went to it through lastfm.ru) / добавлен русский язык (определится автоматически, если на скрипт перешли с русского ластфма)
    - 12 may 2009 - added german language / das deutsche ist beigefügt / thousands of thanks to MrsReeves

    - 14 jun 2009 - fixed a problem with nicks which contains space

    Q&A
    Q: It fetches tracks wrong, I have a screenshot!!
    A: Last.fm counter is a quite buggy thing. If you had removed any tracks from your library or used iPod scrobbling, counter may display it incorrectly. I recommend to save two variants of anniversary tracks - those you've got by yourself and those you've got by anniversary tracks grabber.
    You can try to set an "alt.offset" option.
    You can also try to clear the cache (you may clear it by clicking on a link in top-right corner after you've grabbed anniversaries).

    Q: I always get an empty result, what's wrong?
    A: You have checked "Make listening data private" in your settings. Uncheck it in
    your profile page > "recently listened tracks" > settings > "make this private"
    and script will work correctly :)

    feedback is welcome, yay~ ^_^

    Edited by i0ngunn3r on 14 Jun 2009, 09:31
  • Thank you this is awesome.

    I can't see that thief that lives inside of your head.
    When It Comes, it comes unannounced and it feels like trading brains with an imbecile, for real...
    Yes I feel emphatic about not being static and not eating the bull**** that's being fed to me no more.
  • This does not give the same results as the Greasemonkey script Last.fm - Show landmark tracks [sic], and I think the problem might be that you've missed the scrobbles that aren't included in Last.fm's feeds (i.e. very old scrobbles).

    last.fm#DIV(class=messageSig)
  • brtkrbzhnv can you post here usernames those fetches wrong?
    i've passingly checked source of this userjs and my script goes this way too, it's strange and i'm gonna debug it.
    thank you.

  • http://howite.org/tools/lfg/index.php?username=brtkrbzhnv&step=999999&opt=100276&ts=on&ln=on says:
    100276: (3 hours ago): Frédéric Chopin - Nocturne No. 21 in C minor, Op. post.


    This is my last played track, and the 100276 is the number of tracks the Greasemonkey script finds in my feed, while Last.fm says I have 100556 played tracks.

    last.fm#DIV(class=messageSig)
  • fixed that.
    thanks.

  • It's not working right, for example, I try to get the 6,666 track, which I know it's Iron Maiden's "The Number of the Beast" because I have a screenshot, and yet it shows a different one (the next one I listened to, I presume). This happens with other numbers too, like 30,000.

  • MinaseTaki, it's strange, but track you're looking for now isn't #6,666. :\

    6666th track is Tool - Swamp Song, but you have an offset (counter on your profile and actual count of all your tracks are different numbers (31858 and 31824 respectively), so script turns on a special offset and displays Galneryus - Deep Affection (6632th track) to make ability to grab anniversaries with your actual counter on your profile.
    (i've made a special option to enable/disable this offset, "alt. offset" checkbox)

    Well, The Number of the Beast is now on #6679 position. If you don't believe, you can check it by yourself:

    You have 24 tracks on the last page (at the moment. if you'll scrobble something before you read that, it will change). all other pages have 50 tracks per each page.

    The chain "Prisoner > Total Eclipse > Man on the Edge > Stranger > The Number of the Beast" is on 503th page in the bottom (then some Tool on 504th page).

    24 + (636 - 503) * 50 = 6674 - it's the number of all tracks from 504th to 637th (last) page. Then we'll add 5 (because "The Number of the Beast" is 5th on the bottom on 503th page) and get 6679.

    I have no ideas what's wrong with it. Maybe you have scrobbled something with your iPod later and it added some tracks before 'The Number of the Beast"?

    • m0nkiii said...
    • Subscriber
    • 3 Apr 2009, 16:18
    Nice one!
    Have done a similar page. I also save all tracks in a database and show other stats (see my signature)

    The thing about the playcounter on last.fm is that it might not update after each track. So it isn't that reliable actually.

    I've added many users to my site and realized that many of the users have deleted tracks from their /tracks site. The last.fm playcounter doens't take away deleted tracks. So if you have played 10 000 tracks and delete 500 it will still show 10 000. But when you for example use this tool the 500 tracks will not count.

    So MinaseTaki, don't trust the last.fm counter :P

  • i0ngunn3r said:
    I have no ideas what's wrong with it. Maybe you have scrobbled something with your iPod later and it added some tracks before 'The Number of the Beast"?

    Nope, never used an iPod.

    Ah well.

  • Very nice indeed. I noticed a minor issue though: when "add timestamp" is and "add links to artist/track" isn't checked, I get some broken HTML, such as this:

    36000: (a href="/music/Nora+Naughty">Nora Naughty): Nora Naughty - No One

    You might also want to consider caching a user's tracks for a period of time (a few minutes, perhaps) to allow users to play with the different options without having to grab all the data all over again. And keep up the good work. :)

    • Fulvian said...
    • User
    • 12 Apr 2009, 16:33
    Hmmm somehow it doesn't work with my username, I tried a friend's username and it succeeded. I don't know what's wrong, I wasn't scrobbling and already tried the alt. offset with no success, it always generates empty results. :(

    Tried Firefox, Chrome, IE, they're all the same.

  • penguin_of_zoom
    I noticed a minor issue though: when "add timestamp" is and "add links to artist/track" isn't checked, I get some broken HTML
    Wow. I have a good news - guys from last.fm were added some good code, so I can get full timestamp with seconds too :)

    Timestamps are partially fixed due to this last.fm bug.

    You might also want to consider caching a user's tracks for a period of time (a few minutes, perhaps) to allow users to play with the different options without having to grab all the data all over again. And keep up the good work. :)
    I thought about it. I'll realise it but maybe a few later, sorry.

    Fulvian
    Hmmm somehow it doesn't work with my username, I tried a friend's username and it succeeded. I don't know what's wrong, I wasn't scrobbling and already tried the alt. offset with no success, it always generates empty results. :(

    Tried Firefox, Chrome, IE, they're all the same.

    You had set your listening data to private mode, so script can't see what you have listened. In your profile page, click "Settings" link (right of "Recently listened tracks") and uncheck "Make this private" to make this work.

    Thanks for feedback.

    Edited by i0ngunn3r on 15 Apr 2009, 17:09
  • i0ngunn3r said:
    Wow. I have a good news - guys from last.fm were added some good code, so I can get full timestamp with seconds too :)
    Now timestamps are fixed, thanks for the bug report.


    Awesome! Thanks for all you do. :)

  • penguin_of_zoom said:
    i0ngunn3r said:
    Wow. I have a good news - guys from last.fm were added some good code, so I can get full timestamp with seconds too :)
    Now timestamps are fixed, thanks for the bug report.


    Awesome! Thanks for all you do. :)

    no problems, you're welcome :) i'd wanna add caching today, but my host is suffering DDoS attack atm. Maybe tomorrow.

    Feel free to leave bug reports and feature requests here.

  • That tool is a great idea indeed!

    It grabs the track even if you didn't listen to the full song, though. I am really, really sure, that my 45,000 was not the one the tool grabbed. I think I actually skipped the one shown ...
    Same with my 40,000, 35,000, 30,000 etc...I started to write down my milestones with my 10,000th play and now I wanted to know if my 1000th etc (the ones I figured out manually) were correct - but as the ones I'm sure of aren't right, ...: /

    I do not want people to be very agreeable, as it saves me the trouble of liking them a great deal. - Jane Austen
  • MrsReeves
    It grabs the track even if you didn't listen to the full song, though.
    Huh? That's not my fault :) By default last.fm scrobbler scrobbles track if 50% is listened, so if you're (i.e.) listened 2:00 of 3:15 track then skipped it - it scrobbles and adds to your profile as listened.
    If you don't want to scrobble tracks you've skipped, set "scrobble at 100%" in your last.fm client (or a plugin) preferences.

    I've also fugitively checked your profile.
    1000th track (Enemies) and 5000th (I am) are 982th and 4982th.
    10000th track (Zip-lock) is 9976th.
    15000th track (Dry country) is 14994th. O____O
    prooflink
    there's no system, IMO. dunno what it is.

    Please answer to few questions :)
    1) Where did you identify your anniversary tracks? From your web last.fm profile or from your media player?
    2) Have you ever removed tracks from the library and/or recently listened list?
    3) Do you use iPod scrobbling?

  • Ah, yeah, I didn't mean the 50 % scrobbling but skipping a song within the first few seconds ; )

    Answers to your questions:
    1) I figured track 1,000 and 5,000 out by going back in my listening history on my last.fm profile (I haven't been scrobbling at that time, I kinda knew they wouldn't be accurate though...; ) ) from then onwards I always noted them down while listening - using the counter on my profile.
    2) I did remove some tracks but certainly didn't do that before a half year ago or so. Those tracks remain in your history/playcounter even if you remove them from your profile? Well, cheers, definitely didn't know that! =)
    3) Well, I am scrobbling my mp3 player - it's not an ipod - but I figured that one out only about a half year ago or so, too. I guessed that would mess up the milestones so I upload my plays long before or after reaching another milestone...

    Oh well, as I noted the "actually listened" tracks down anyway ... : )
    Thanks for your quick response though!

    I do not want people to be very agreeable, as it saves me the trouble of liking them a great deal. - Jane Austen
  • MrsReeves
    Ah, yeah, I didn't mean the 50 % scrobbling but skipping a song within the first few seconds ; )
    Well then song you've skipped doesn't scrobbles to last.fm, so script can't see it in your history :)

    Those tracks remain in your history/playcounter even if you remove them from your profile?
    Seems so, but it remains only in playcounter, not in the history. We've discussed it upper in this thread.

    • Tecfan said...
    • Subscriber
    • 20 Apr 2009, 15:13
    aaargh, the song I thought was number 50 000, wasn't number 50 000 :( at least not anymore, because I deleted some time ago

    Check out my band: Hamu(e)mon (or my solo project, if you dare: Tecfan)
    My groups: It's all about the bass - Norwegian Music - Chuck (TV Series) - Californication (TV Series) - Rogaland - Catch-Gamer.no
  • Superb - works perfectly. Many thanks.

    1 small suggestion - an option to link artists and not tracks would be good (then you wouldn't get the last.fm 'play' button in the middle of the listing).

    • B1axun said...
    • User
    • 24 Apr 2009, 17:10
    very cool! thanks!

  • wolfpupjon, sorry, I have a lot of problems in RL, can't do it in the near future.
    B1axun, thank you ^_^

  • NP - you are a star for providing it in the first place :)

  • wolfpupjon, hm, i don't think so. :\
    anyway, i did it. my apologies for your waiting.

Anonymous users may not post messages. Please log in or create an account to post in the forums.