Took a little inspiration from the News widget to construct this Reddit widget. Simply add the subreddit .json feed URLs that you want to the top of the reddit.rb job script, and the widget will cycle through each one, showing top posts, their score, and comment count. You can also set the maxcount higher or lower, the default is 5 posts.
##Usage
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="4" data-sizey="1">
<div data-id="reddit" data-view="Reddit"></div>
</li>
@MaxCount doesn't seem to work properly. If set to 1, I still get 2 posts.
In addition, when the scheduler runs the "getTopPostsPerSubreddit" my entire widget goes blank (no data) until it refreshes. Any ideas?