SkillAgentSearch skills...

Lastfmapi.java

Java bindings for the last.fm API

Install / Use

/learn @dontdrinkandroot/Lastfmapi.java
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Java bindings for the last.fm API

Flattr this git repo

Donate

Maven

To use the library in your maven managed project, simply add the following to your pom.xml

<repositories>
  ...
  <repository>
    <id>public</id> <!-- or whatever id you want -->
    <url>http://maven.dontdrinkandroot.net/content/groups/public</url>
  </repository>
  ...
</repositories>

<dependencies>
  ...
  <dependency>
    <groupId>net.dontdrinkandroot</groupId>
    <artifactId>lastfmapi</artifactId>
    <version>${lastfmapi.version}</version> <!-- Replace with desired version -->
  </dependency>
  ...
</dependencies>

Usage

To create a new Instance of the LastfmWebServices simply do the following:

String apiKey = "yourapikey";
String apiSecret = "yourapisecret";
LastfmWebServices ws = new DefaultLastfmWebServices(apiKey, apiSecret);

To perform requests you can then use this instance:

List<User> getAllFriends(String userName, LastfmWebServices ws) throws LastfmWebServicesException {

  List<User> friends = new ArrayList<User>();
  PaginatedResult<List<User>> result = ws.fetch(User.getFriends(userName, null, null, 1));
  friends.addAll(result.getEntries());
  while (result.hasMorePages()) {
    result = ws.fetch(User.getFriends(userName, null, null, result.getNextPage()));
    friends.addAll(result.getEntries());
  }

  return friends;
}
View on GitHub
GitHub Stars11
CategoryDevelopment
Updated1y ago
Forks3

Languages

Java

Security Score

60/100

Audited on Apr 2, 2024

No findings