Here's a live demo http://dogdash.herokuapp.com/
Code example: https://github.com/bennycwong/dogdash
Dashing widget to display a random gif from reddit
The display of the widget is heavily based on the Image widget, however it does not prepend the src with 'assets' which allows for external images.
You can set a placeholder image in the event that reddit is down, or otherwise unresponse. This is set at the top of random_aww.rb as follows:
placeholder = '/assets/nyantocat.gif'
This can be an image in /assets/images, or a full path to a remotely hosted image.
subreddits = {
'nonononoyes' => '/r/nonononoyes/hot.json?limit=100',
'abj' => '/r/animalsbeingjerks/hot.json?limit=100'
}
To use this widget, copy reddit.html, reddit.coffee, and reddit.scss into the /widgets/reddit directory. Put the reddit.rb file in your /jobs folder.
To include the widget in a dashboard, add the following snippet to the dashboard layout file:
<li data-row="1" data-col="1" data-sizex="2" data-sizey="1">
<div data-id="abj" data-view="RandomReddit"></div>
</li>