Implementing love/hate and skip commands?

2 views
Skip to first unread message

Daisy

unread,
Jul 6, 2010, 3:11:38 AM7/6/10
to thelastripper-dev
Hi all,

since i haven't managed to get thelastripper working under OS X 10.6.x
and it refused working for me under 10.5 after using it successfully
some weeks under 10.5.x, I thought a little while if I can support OS
X development of TLR. Unfortunately I have absolutely no experience
with c sharp and the used API at all - so I decided to write my own
ripper (as native Cocoa/Obj-C application). It works nice so far -
plays/rips/writes tags/sorts the downloads etc.) but some features
are not yet working. (If i manage to make it a full replacement for
TLR for OS X I will release it as Freeware - of couse including a big
thank you & credits for the thelastripper developers).

-> Now my problem: I have tried to implement the love/hate/skip
commands - i have a method giving me the service url as a string and
append session ID, command ("love", "ban" or "skip") and "debug=0",
like i have seen it's done in the sources of thelastripper: ...
"%@control.php?session=%@&command=%@&debug=0" ... (where "%@" is the
variable placeholder) - it results a URL String like this:

http://ws.audioscrobbler.com/radio/control.php?session=4ca9b92207ea5f46763d1fc6fd60f9bd&command=love&debug=0

but whatever I try (sending this using GET and POST) - i always get a
'Not Found' HTML answer:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>404 Not Found</TITLE>
</HEAD><BODY>
<H1>Not Found</H1>
The requested URL /radio/control.php was not found on this server.<P>
<HR>
<ADDRESS>Apache/1.3.39 Server at ws.audioscrobbler.com Port 80</
ADDRESS>
</BODY></HTML>


What's wrong with this? Is the control.php url outdated? can it be
replaced by sth new?
Many thanks for you help in advance.

D.

Jonas Finnemann Jensen

unread,
Jul 6, 2010, 1:40:57 PM7/6/10
to thelastr...@googlegroups.com
Hi,

You don't have to read TheLastRipper sources to find out how it works... We've documented the last.fm protocol version 1.2 here:

Please note that the last.fm protocol version 1.2. is outdated and have been for quite a while.
The official public last.fm API is available here:

We've previously discussed moving to this protocol, but it never happened... If you wish to do so you should probably reverse engineer the API key from the official last.fm client, it's less likely that they'll shut that one down...
Otherwise the 1.2 API is also fine, but it's probably in legacy mode... Which is likely the course of the current bug in TheLastRipper... So I wouldn't expect all features to work, and certainly not expect service to be stable...

By the way, if you publish you client please let us know, by posting a link here :)

 - Best of luck with your project...

--
Regards Jonas Finnemann Jensen.



--
You received this message because you are subscribed to the Google Groups "thelastripper-dev" group.
To post to this group, send email to thelastr...@googlegroups.com.
To unsubscribe from this group, send email to thelastripper-...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/thelastripper-dev?hl=en.


Daisy

unread,
Jul 10, 2010, 2:55:35 AM7/10/10
to thelastripper-dev
Hi Jonas,

many thanks for your answer. I thought about using the new API when I
startet my project. I decided not to, since this would either mean:
registering for a key with lastfm (an probably being banned when
pulishing a ripping app) or stealing a key. Would not be a big deal -
I already made some successful test. But: I guess this might be a
legal problem when I publish my app ...

So I use 1.2 now - love & ban work (posting an xml with command,
title an artist etc.), but I still have no clue what to do for
skipping a track. Do I have to post a command like loveTrack or
banTrack? I haven't found any information. And I heard there is a
maximum of allowed skips (per day/per session/...) - do you have any
more detailed information?


Many thanks for your help again.

Regards

Daisy

Jonas Finnemann Jensen

unread,
Jul 10, 2010, 4:52:04 AM7/10/10
to thelastr...@googlegroups.com
Hi Daisy,

If your using last.fm protocol 1.2 skipping is pretty trivial, you just go ahead with the next song... At least that's what I've understood and we've done...
I assume you're using the XSPF it has multiple tracks, if the user pushes skip, just skip the current track.

The request for the XSPF can be found here:

--
Regards Jonas Finnemann Jensen.



--

Daisy

unread,
Jul 10, 2010, 11:14:27 AM7/10/10
to thelastripper-dev


On 10 Jul., 10:52, Jonas Finnemann Jensen <jop...@gmail.com> wrote:

> you just go
> ahead with the next song...


Oh - the solution is soo simple - and I searched and searched ... ;-)

Many thanks.

D.
Reply all
Reply to author
Forward
0 new messages