Package de.umass.lastfm.scrobble
Class Scrobbler
java.lang.Object
de.umass.lastfm.scrobble.Scrobbler
Deprecated.
The 1.2.x scrobble protocol has now been deprecated in favour of the 2.0 protocol which is part of the Last.fm web services
API.
This class manages communication with the server for scrobbling songs. You can retrieve an instance of this class by calling
It contains methods to perform the handshake, notify Last.fm about a now playing song and submitting songs to a musical profile, aka scrobbling songs.
See http://www.last.fm/api/submissions for a deeper explanation of the protocol and various guidelines on how to use the scrobbling service, since this class does not cover error handling or caching.
All methods in this class, which are communicating with the server, return an instance of
This class respects the
newScrobbler
.It contains methods to perform the handshake, notify Last.fm about a now playing song and submitting songs to a musical profile, aka scrobbling songs.
See http://www.last.fm/api/submissions for a deeper explanation of the protocol and various guidelines on how to use the scrobbling service, since this class does not cover error handling or caching.
All methods in this class, which are communicating with the server, return an instance of
ResponseStatus
which contains
information if the operation was successful or not.This class respects the
proxy
property in the Caller
class in all its HTTP calls. If you need the
Scrobbler
to use a Proxy server, set it with Caller.setProxy(java.net.Proxy)
.- Author:
- Janni Kovacs
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Performs a web-service handshake.Deprecated.Performs a standard handshake with the user's password.static Scrobbler
newScrobbler
(String clientId, String clientVersion, String user) Deprecated.Creates a newScrobbler
instance bound to the specifieduser
.nowPlaying
(String artist, String track) Deprecated.Submits 'now playing' information.nowPlaying
(String artist, String track, String album, int length, int tracknumber) Deprecated.Submits 'now playing' information.void
setHandshakeURL
(String handshakeUrl) Deprecated.Sets the URL to use to perform a handshake.submit
(SubmissionData data) Deprecated.Scrobbles a song.submit
(String artist, String track, String album, int length, int tracknumber, Source source, long startTime) Deprecated.Scrobbles a song.submit
(Collection<SubmissionData> data) Deprecated.Scrobbles up to 50 songs at once.
-
Method Details
-
setHandshakeURL
Deprecated.Sets the URL to use to perform a handshake. Use this method to redirect your scrobbles to another service, like Libre.fm.- Parameters:
handshakeUrl
- The new handshake url.
-
newScrobbler
Deprecated.Creates a newScrobbler
instance bound to the specifieduser
.- Parameters:
clientId
- The client id (or "tst")clientVersion
- The client version (or "1.0")user
- The last.fm user- Returns:
- a new
Scrobbler
instance
-
handshake
Deprecated.Performs a standard handshake with the user's password.- Parameters:
password
- The user's password- Returns:
- the status of the operation
- Throws:
IOException
- on I/O errors
-
handshake
Deprecated.Performs a web-service handshake.- Parameters:
session
- An authenticated Session.- Returns:
- the status of the operation
- Throws:
IOException
- on I/O errors- See Also:
-
nowPlaying
Deprecated.Submits 'now playing' information. This does not affect the musical profile of the user.- Parameters:
artist
- The artist's nametrack
- The track's title- Returns:
- the status of the operation
- Throws:
IOException
- on I/O errors
-
nowPlaying
public ResponseStatus nowPlaying(String artist, String track, String album, int length, int tracknumber) throws IOException Deprecated.Submits 'now playing' information. This does not affect the musical profile of the user.- Parameters:
artist
- The artist's nametrack
- The track's titlealbum
- The album ornull
length
- The length of the track in secondstracknumber
- The position of the track in the album or -1- Returns:
- the status of the operation
- Throws:
IOException
- on I/O errors
-
submit
public ResponseStatus submit(String artist, String track, String album, int length, int tracknumber, Source source, long startTime) throws IOException Deprecated.Scrobbles a song.- Parameters:
artist
- The artist's nametrack
- The track's titlealbum
- The album ornull
length
- The length of the track in secondstracknumber
- The position of the track in the album or -1source
- The source of the trackstartTime
- The time the track started playing in UNIX timestamp format and UTC time zone- Returns:
- the status of the operation
- Throws:
IOException
- on I/O errors
-
submit
Deprecated.Scrobbles a song.- Parameters:
data
- Contains song information- Returns:
- the status of the operation
- Throws:
IOException
- on I/O errors
-
submit
Deprecated.Scrobbles up to 50 songs at once. Song info is contained in theCollection
passed. Songs must be in chronological order of their play, that means the track first in the list has been played before the track second in the list and so on.- Parameters:
data
- A list of song infos- Returns:
- the status of the operation
- Throws:
IOException
- on I/O errorsIllegalArgumentException
- if data contains more than 50 entries
-