This jsApp will fetch your Dribbble shots from across the court (aka Internets) and display them in a fancy little widgeto. It was a collab effort between mediaHACK <codes> and KomodoMedia <pretties>. The source is hosted at Google Code.
If you have any questions, suggestions or issues let me know on twitter.
Usage
If you want to just use this and instantly go, copy the code directly below and replace the jersey name "Rogie" with your own.
<link href="https://halfcourtshot.googlecode.com/svn/tags/101129.1100/style/half-court-shot.css" rel="stylesheet" type="text/css" />
<div id="dribbble"></div>
<script type="text/javascript" src = "https://halfcourtshot.googlecode.com/svn/tags/101129.1100/js/half-court-shot.jsapp.mh.min.js"></script>
<script type="text/javascript">var hcs = new HalfCourtShot({ jersey: "Rogie", shots: 4, goal: 'dribbble' });</script>
The instances of a shot can be passed a settings object. If you don't give it a settings object then you'll just get the app appended to your HTML body tag.
Styles
There is a default style sheet you can include.
<link href="https://halfcourtshot.googlecode.com/svn/tags/101129.1100/style/half-court-shot.css" rel="stylesheet" />
Settings
A settings object with the following properties can be passed to the constructor
- goal: ID of the target element to load the app into. For example,<div id="mydribbble"></div>. Default is appended to body tag
- jersey: Who do you want to watch shoot? Default is random from rogie, simplebits, shauninman, jsm
- playType: shots|players
- shots: The number of shots to return
- className: This will override the app container with the class you want to use
- page: The current page you want to view
- per_page: How many shots per page
- following: Show who the player (specified by the jersey property) is following
Examples
Basic with no tweaking. The hcs object we create is arbitrary. You can call it whatever you want and create as many instances as you want. Just drop these script tags at the bottom of your page before the closing body tag.
<script type="text/javascript" src = "https://halfcourtshot.googlecode.com/svn/tags/101129.1100/js/half-court-shot.jsapp.mh.min.js"></script> <script type="text/javascript">var hcs = new HalfCourtShot();</script>
This example is targeted at Rogie and an element where he wanted the app to be injected into
<script type="text/javascript" src = "https://halfcourtshot.googlecode.com/svn/tags/101129.1100/js/half-court-shot.jsapp.mh.min.js"></script>
<script type="text/javascript">var hcs = new HalfCourtShot({ jersey: "Rogie", shots: 6, goal: 'dribbble' });</script>
Donate
If you like this and you want to donate to keep me moving forward on this, feel free to make a donation here