use of org.apache.http.message.BasicNameValuePair in project musiccabinet by hakko.
the class UserRecommendedArtistsClient method getUserRecommendedArtists.
public WSResponse getUserRecommendedArtists(String lastFmUsername) throws ApplicationException {
LastFmUser user = lastFmDao.getLastFmUser(lastFmUsername);
WebserviceInvocation webserviceInvocation = new WebserviceInvocation(USER_GET_RECOMMENDED_ARTISTS, user);
List<NameValuePair> params = getDefaultParameterList();
params.add(new BasicNameValuePair(PARAM_METHOD, METHOD));
params.add(new BasicNameValuePair(PARAM_LIMIT, "100"));
params.add(new BasicNameValuePair(PARAM_SK, user.getSessionKey()));
return executeWSRequest(webserviceInvocation, params);
}
use of org.apache.http.message.BasicNameValuePair in project musiccabinet by hakko.
the class UserTopArtistsClient method getUserTopArtists.
public WSResponse getUserTopArtists(LastFmUser user, Period period) throws ApplicationException {
WebserviceInvocation webserviceInvocation = new WebserviceInvocation(USER_GET_TOP_ARTISTS, user, period.getDays());
List<NameValuePair> params = getDefaultParameterList();
params.add(new BasicNameValuePair(PARAM_METHOD, METHOD));
params.add(new BasicNameValuePair(PARAM_USER, user.getLastFmUsername()));
params.add(new BasicNameValuePair(PARAM_PERIOD, period.getDescription()));
return executeWSRequest(webserviceInvocation, params);
}
use of org.apache.http.message.BasicNameValuePair in project musiccabinet by hakko.
the class ArtistQueryClient method get.
public String get(String artistName) throws ApplicationException {
WebserviceInvocation invocation = new WebserviceInvocation(MB_ARTIST_QUERY, new Artist(artistName));
List<NameValuePair> params = new ArrayList<>();
params.add(new BasicNameValuePair(QUERY, ARTIST + escape(artistName)));
params.add(new BasicNameValuePair(LIMIT, ONE));
return executeWSRequest(invocation, PATH, params);
}
use of org.apache.http.message.BasicNameValuePair in project musiccabinet by hakko.
the class ReleaseClient method get.
public String get(String artistName, String mbid, int offset) throws ApplicationException {
WebserviceInvocation invocation = new WebserviceInvocation(MB_RELEASE_GROUPS, new Artist(artistName));
List<NameValuePair> params = new ArrayList<>();
params.add(new BasicNameValuePair(QUERY, format(PATTERN, mbid)));
params.add(new BasicNameValuePair(LIMIT, HUNDRED));
params.add(new BasicNameValuePair(OFFSET, valueOf(offset)));
return executeWSRequest(invocation, PATH, params);
}
use of org.apache.http.message.BasicNameValuePair in project musiccabinet by hakko.
the class ArtistSimilarityClient method getArtistSimilarity.
public WSResponse getArtistSimilarity(Artist artist) throws ApplicationException {
WebserviceInvocation webserviceInvocation = new WebserviceInvocation(ARTIST_GET_SIMILAR, artist);
List<NameValuePair> params = getDefaultParameterList();
params.add(new BasicNameValuePair(PARAM_METHOD, METHOD));
params.add(new BasicNameValuePair(PARAM_ARTIST, artist.getName()));
return executeWSRequest(webserviceInvocation, params);
}
Aggregations