Scattered about my home are lists of things to do. The first thing to do on quite a few of these todo lists is: Find the old todo list
Since I would sometimes spend more time looking for a missing list than I would spend actually doing something on the list, putting things to do on a piece or paper is a very inefficient way to keep track of what I need to do.
Fortunately, one of my federated status.net buddies told me about MyTinyToDo; a sweet todo list that one can install on their own server if they happen to know how to do such things. As it happens, I have such skills.
A few minutes of tinkering and a new subdomain later, my todo list went from being a scattered collection of paper to a nice tidy website that I can access from almost anywhere. awesome sauce!
But how will I know how many things are on my todo list if I don't have the list opened in a browser window? Good question, I'm glad I asked it.
MyTinyToDo can be configured to provide an RSS feed of a list and I decided to get a binary representation of the number of unfinished items on the list from the RSS feed. A short Ruby script does this quite well.
Enter The Ruby
#we need to read from a uri
require 'open-uri'
#we will need to parse xml
require 'rexml/document'
uri = "http://todo.jezra.net/feed.php?list=1"
begin
#read the xml data from the feed
xml_data = open(uri).read()
rescue
puts "failed to read text from #{uri}"
exit
end
#parse the XML
doc = REXML::Document.new(xml_data)
uncompleted_item_count = 0
#loop through the "items" in the feed
doc.elements.each('rss/channel/item') do |i|
uncompleted_item_count+=1 unless /Completed: / =~ i.elements['description'].text
end
binary = "%b" % uncompleted_item_count
leds = binary.reverse.ljust(6,"0")
p leds
For more information about the machine that displays the number of items on the list, check out http://www.jezra.net/blog/LEDs_BeagleBone_and_my_ToDo_List
Now I need to find a missing key. Rock on, and go make some copies of your keys.