You are not logged in.

#1 2009-06-02 15:55:30

whoops
Member
Registered: 2009-03-19
Posts: 891

last.fm - manually generate & upload statistics?

Hi!


There are quite a few tools in the repos that seem to offer support to upload statistical data to a last.fm account while plaing music located in the filesystem, but...

- Does anyone know, how that's transmitted? Like how the "file" looks or what protocol/methods are available?
- How to manually upload "artist - title - played"?
- How to have whole directories of mp3's uploaded as "played" (or text files / lists)?
- Where to start figuring all that out?

( To put that into a context: I'm trying to improve my recommended channel here. )


Thanks!

Offline

#2 2009-06-02 16:59:27

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: last.fm - manually generate & upload statistics?

http://www.audioscrobbler.net/wiki/Port … er_Logging For uploading my log, which is being created by Rockbox (http://www.rockbox.org) I use qtscrob from AUR

Offline

#3 2009-06-04 16:20:01

whoops
Member
Registered: 2009-03-19
Posts: 891

Re: last.fm - manually generate & upload statistics?

Thanks, so far so good...


write header:

echo "#AUDIOSCROBBLER/1.1\n#TZ/TC\n#CLIENT/<lastmsg0.1>" > .scrobbler.log

add lines for all mp3 files in directory / subdirectory:

while read file; do mp3info -p "%a\t%l\t%t\t%n\t%s\tL\t$TIMESTAMP\t$ID\t\n" "$file" >> .scrobbler.log; done < <(find ./ -name '*mp3')

... now:


1) Strange: the second line does work from command line, but not inside a bash script. I'm totally new to writing/using scripts, so maybe to anyone else it's obvious why it says: " genera.sh: line 4: syntax error near unexpected token `\<' "?

2) I'm wondering, if small differences in play time (seconds) have a big impact on recommendations quality (maybe half of the files result in an own entry noone else shares as played/loved because of +- 3-5 seconds)? Does lastfm correct that or am I supposed to?

3) Also the timestamp... is this used for anything or just "eyecandy"? I'm thinking of maybe just setting it to generate timestamps with a delay of random 22-33 minutes between each "play" backwards from the actual timestamp or something... something?

4) Less of a problem I guess, but non the less: Is there an easy AND basic approach to upload these things? Like with some post/http/ftp/hatever tool? Didn't look into that yet, but "qtscrob" sounds like "GUI for KDE and 100 dependencies included" and "Perl script to submit these" sounds like "a quick look into that will make me accidentally learn the basics of perl for the next 10 hours"...

5) Unimportant: This "MusicBrainz Track ID" actually IS unimportant, isn't it? Or is there an easy way to get it? (like a Program that can optionally put it into the id3 tag of all mp3's or a way to generate it from info that's already in there)

Last edited by whoops (2009-06-04 16:28:15)

Offline

#4 2009-06-10 15:02:03

whoops
Member
Registered: 2009-03-19
Posts: 891

Re: last.fm - manually generate & upload statistics?

So far, this:

#!/bin/bash

echo "#AUDIOSCROBBLER/1.1\n#TZ/TC\n#CLIENT/<lastmsg0.1>" > .scrobbler.log;
RANDOM=$$$(date +%s);
while read file; do 
tstamp=$[$(date +%s) - ($RANDOM % 3600000)];
line=$(mp3info -p "%a\t%l\t%t\t%n\t%S\tL\tTIMESTAMP\t\t\n" "$file");
line=$(echo "$line" | sed "s/\tTIMESTAMP\t/\t$tstamp\t/");
echo $line;
echo "$line" >> .scrobbler.log;
done < <(find ./ -type f -name '*mp3');

... is working together with this web toot to upload the log's. I'm not entirely sure, if it maybe can only upload 100 "played" songs at once, which would be bad... gotta keep trying, seems to take a while to update the lastfm profile.

Still searching for something better... can't figure out how that stuff is uploaded, can't find any information on it. The site mentioned above writes stuff like "handshake successful" etc. and I wonder what sort of protocol/stuff and if that could be done using 1 or 2 standard tools using bash or something (don't expect it'll just be standard/easy ftp or smtp, but it's gotta be SOMETHING - or did they invent whatever it is only just to upload stats to lastFM !?) - this would be particularly useful, if it'd turned out I need to split the log files every 100 entries and send them separately.

Last edited by whoops (2009-06-13 11:46:49)

Offline

#5 2009-06-13 11:43:42

whoops
Member
Registered: 2009-03-19
Posts: 891

Re: last.fm - manually generate & upload statistics?

At the moment I've got the problem, that only few of the entires I transmitted really show up on last.fm as played... does anybody have an idea why?

Is this common when using "naturally generated" log files (e.g. do I have to work on some way to enhance the quality of information in my ID3-Tags or on how the log is generated)?

(edit: playing time seconds in script corrected - still not much better)

thx

Last edited by whoops (2009-06-13 11:46:35)

Offline

Board footer

Powered by FluxBB