Milkman widget for Dashing, which uses the Milkman gem to retrieve tasks from Remember The Milk (RTM). It displays the tasks sorted by date (by default), but it can also sort the tasks by priority. An example of the former can be viewed below.
Milkman is a dependency of the Milkman widget, which has basically been created especially for this widget. So, add milkman
to the Gemfile of your Dashing dashboard:
gem "milkman"
This widget has been Hamlified (we're using a HAML template in the /widgets/milkman
directory instead of an HTML template), so besides the above you'll also need to add haml
to the Gemfile (if you haven't already):
gem "haml"
and require it in your config.ru
file right below the require of dashing itself. So the first few lines of your config.ru
should look something like the following:
require 'dashing'
require 'haml'
configure do
...
Now run bundle install
.
To actually use the widget on your own Dashboard, you'll have to request an API key and shared secret from Remember The Milk. With those variables you'll be able to retrieve an authentication token. The three of them are required to use Milkman. For detailed information about authorizing Milkman, check the gem's documentation. You'll need to read "Apply for an API key and shared secret".
In short, you'll need to run the milkman
executable:
milkman authorize API_KEY SHARED_SECRET
Follow it's instructions (you'll have to copy an authorization URL) and the instructions on the Remember The Milk site to authorize Milkman. Once you've done that you'll receive a frob
value. Copy and paste that in the shell. The description which follows will include the three variables you'll need to copy to the job file of this widget, as shown in the usage section.
To use this widget, copy milkman.coffee
, milkman.haml
and milkman.sass
into the /widgets/milkman
directory of your dashboard. Copy milkman.png
into the /assets/images
directory and put the milkman.rb
file in your /jobs
folder.
To include the widget on your dashboard, add the following snippet to the dashboard layout file:
<li data-row="1" data-col="1" data-sizex="1" data-sizey="1">
<div data-id="milkman" data-view="Milkman"></div>
</li>
When you're using a Hamlified dashboard layout (hey, you're already using a Hamlified widget, so why not Hamlify your dashboard layout?), you could also do the following:
%li(data-row="1" data-col="1" data-sizex="1" data-sizey="1")
%div(data-id="milkman" data-view="Milkman")
On to the next part. Enter the API key, shared secret and authentication token in the milkman.rb
job file:
# milkman configuration
api_key = "API_KEY"
shared_secret = "SHARED_SECRET"
auth_token = "AUTH_TOKEN"
And your done. That's really it. Now... use it!
By default the Milkman widget will display all incomplete tasks, which are due before today and will be overdue tomorrow. So, all tasks for today.
# widget configuration
filter = 'status:incomplete AND (dueBefore:today OR dueWithin:"1 day of today")'
date_format = "%d/%m/%y"
sort_by = "date"
max_items = 8
The filter
in the above configuration can be changed by using one of the available options. The date_format
can be changed to something of your liking. The same applies to the max_items
configuration option.
As described in the introduction of this widget, the tasks can be sorted by date (as shown above) or by priority. Simply fill in priority
instead of date
as the value for sort_by
to do just that:
sort_by = "priority"
Copyright 2013 Kevin Tuhumury. Released under the MIT License. This product uses the Remember The Milk API, but is not endorsed or certified by Remember The Milk.