Rate-Limited Java Client Dribbble API
Posted on 18 April 2012
I am happy to finish and open-source a strongly-typed, rate-limited Java Client library for
Dribbble called dribbble-java-client
.
dribbble-java-client
is a strongly typed Java library for accessing
http://dribbble.com API. The library provides
support for rate limiting requests. All objects implement the necessary
equals
, hashcode
and toString
methods for easier usage. Also, implemented is
the Comparable interface for comparison and sorting.
The library also exposes a convenience class called
DribbbleInvoker
that may be used to add more APIs (should they get added in
future and this library looses track). The invoker is rate-limit safe.
Usage
DribbbleClient client = new DribbbleClient();
// get info on shot with ID: 1
Shot shot = client.getShot(1);
// get info on this shot's player
Player player = client.getPlayer(shot.getPlayer().getId());
// do more...
Pagination Support
All API methods that support pagination have a corresponding, pagination-aware method available as well. For example, when fetching comments for a shot you may do,
DribbbleClient client = new DribbbleClient();
CommentList list = getShotComments(1);
// do something with these comments
if(list.getPage() < list.getPages()) {
list = getShotComments(1, 2); // to get default page 2
// or, may provide the number of results to fetch as well
list = getShotComments(1, 2, 15);
}
// get more comments
The current default for number of results per page is 15 per Dribbble API. Refer http://dribbble.com/api for more details.
Project Links
More details on the project can be found on project home page,
http://www.sangupta.com/projects/dribbble-java-client.
Source Code:
https://github.com/sangupta/dribbble-java-client
Downloads:
https://github.com/sangupta/dribbble-java-client/downloads
Issue Management:
https://github.com/sangupta/dribbble-java-client/issues
Usage Instructions:
https://github.com/sangupta/dribbble-java-client/blob/master/README.md
Hope this helps.