Page 1 of 1

Last.fm Plugin

Posted: Sun Jan 07, 2007 11:48 pm
by echox
I've created a small plugin to show the latest songs from last.fm because I wasn't able to get audioscruggler to work :)

Just enter your last.fm username, the count of songs to show and if you want to see the timestamp when you heard it.

The code is not ver pretty but it works fine and will also work when allow_fopen is off for security reasons.

Just extract http://www.echox.de/downloads/lastfm_pl ... 1.0.tar.gz to your plugins directory and add it to your sidebar.

Suggestions are welcome and I hope this kind of posting is ok here.

Posted: Mon Jan 08, 2007 3:36 am
by judebert
Exactly the right place. Good job! I'm sure it'll be added to the repository soon.

Posted: Mon Jan 08, 2007 11:36 am
by garvinhicking
Hi!

Great work, would you like me to add your plugin to spartacus?

Best regards,
Garvin

Posted: Mon Jan 08, 2007 2:57 pm
by echox
garvinhicking wrote:Hi!

Great work, would you like me to add your plugin to spartacus?

Best regards,
Garvin
If this is possible, it would be wonderfull :D
thx for the feedback

Posted: Mon Jan 08, 2007 3:32 pm
by mattsches
Guys, isn't this what the already existing Audioscrobbler plugin does? Audioscrobbler had been acquired by last.fm quite some time ago, and AFAIK last.fm now offers all the Audioscrobbler services. Please check with the author of the audioscrobbler plugin, Flo, before you add this to spartacus

Posted: Mon Jan 08, 2007 4:10 pm
by echox
Ok, I didn't really realize the connection between Audioscrobbler and Last.fm, this is because I just quickly tested audioscrobbler and could see that it doesn't work and then quickly wrote this plugin.
I thought the existing audioscrobbler plugin doesn't work because as was bought by last.fm, etc.

Now I had a look on the source and this looks like a small php problem, nothing else. I just did a quick and dirty fix (removed call of reencode because I use utf-8) and it works without any problem, does the same thing like my plugin does but a little bit smarter (cache, nice xml parsing, etc.).

I really can't figure out whats the exact problem with the audiscrobbler plugin but I think the author should be able to quickly fix it.

Posted: Tue Jan 16, 2007 9:55 am
by DevilDawn
echox wrote:I really can't figure out whats the exact problem with the audiscrobbler plugin but I think the author should be able to quickly fix it.
It seems the plugin calls the "reencode" method without "$this->". I made it work for me by simply changing these lines:
grep -n '$this->reencode' serendipity_plugin_audioscrobbler.php wrote: 251: $songs[$counter]['link'] = $this->reencode($xml['value']);
255: $songs[$counter]['songtitle'] = $this->reencode($xml['value']);
259: $songs[$counter]['date'] = $this->reencode($xml['attributes']['UTS']);
263: $songs[$counter]['songlink'] = trim($this->reencode($xml['value']));
268: $songs[$counter]['artisttitle'] = $this->reencode($xml['value']);
273: $songs[$counter]['description'] = $this->reencode($xml['value']);
275: $songs[$counter]['date'] = $this->reencode($xml['value']);
277: $songs[$counter]['songtitle'] = $this->reencode($xml['value']);
280: $songs[$counter]['artistlink'] = $this->reencode($xml['attributes']['RDF:ABOUT']);
282: $songs[$counter]['artisttitle'] = $this->reencode($xml['value']);
285: $songs[$counter]['albumtitle'] = $this->reencode($xml['value']);

Posted: Tue Jan 16, 2007 1:36 pm
by garvinhicking
Hi!

Thanks a lot, DevilDawn, I committed your fix!

Best regards,
Garvin

Posted: Thu Feb 22, 2007 8:27 pm
by k1x
Hi,

I'm using the last.fm plugin and it's a very good plugin!!!! :P

But I've a problem regarding the caching of the songs. so that every day after not hearing songs for some hours - the list is again empty. Due to the fact that the plugin gets the songs from a file on audioscrobbler - i think the saved history is deleted in anyway during the night.

Is there a possibility to let the songs in the list also when they are some days old (when i'm not hearing music on my computer)?