Skip to content

evandroeisinger/dribbble.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dribbble.js

A simple pure javascript library created to help develop applications using Dribbble API.

Require

<script type="text/javascript" src="js/dribbble.js"></script>

Usage

// get the most popular shots
Dribbble.list( 'popular', function( response ){
	
	// code here

});

// get player profile
Dribbble.player( 'fguth', function( response ){
	
	// code here

});

// get list of players followed by a player 
Dribbble.following( 'fguth', false, function( response ){
	
	// code here

});

// get shots of the players followed by a player 
Dribbble.following( 'fguth', true, function( response ){
	
	// code here

});

Methods

Method Description Pagination
Dribbble.list( String, Function ) Returns the specified list of shots of the following values: debuts, everyone, popular. True
Dribbble.player( Number/String, Function ) Returns profile details for a player specified by id or nickname. False
Dribbble.shots( Number/String, Function ) Returns the most recent shots for the player specified by id or nickname. True
Dribbble.shot( Number, Function ) Returns details for a shot specified by id. False
Dribbble.comments( Number, Function ) Returns the set of comments for the shot specified by id. True
Dribbble.likes( Number/String, Function ) Returns shots liked by the player specified by id or nickname. True
Dribbble.draftees( Number/String, Function ) Returns the list of players drafted by the player specified by id or nickname. True
Dribbble.followers( Number/String, Function ) Returns the list of followers for a player specified by id or nickname. True
Dribbble.following( Number/String, Boolean,Function ) Returns the list of players followed by the player specified by id or nickname or the most recent shots published by those the player is following. True
Dribbble.rebounds( Number, Function ) Returns the set of rebounds (shots in response to a shot) for the shot specified by id. True

Callback

All methods require a callback function.

// callback method to view the response data
var view = function( data ) {
	console.log( data )
}

// get the most 10 popular shots
Dribbble.list( 'popular', view );

Pagination

API calls that return a pageable list share standard paging parameters. Paging may be limited, both in the total number of pages and the number of results per page.

// get the most 10 popular shots
Dribbble.list( 'popular', callback, 10 );

// get the second page of most popular shots
Dribbble.list( 'popular', callback, 10, 2 );

Browser Support

All browsers (Firefox, Chrome, Safari, Opera, IE7+) should be supported. Please open an issue if Dribbble.js doesn't work on a particular browser.

Contributing

Anyone and everyone is welcome to contribute.


Licensed under the MIT license.

Copyright © 2012 Evandro Eisinger

About

Simple pure javascript library created to help develop applications using Dribbble API.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published