Skip to content

Instantly share code, notes, and snippets.

@cziko
Forked from marcinbunsch/things-yammer-checkin
Created July 8, 2011 12:00
Show Gist options
  • Save cziko/1071685 to your computer and use it in GitHub Desktop.
Save cziko/1071685 to your computer and use it in GitHub Desktop.
Things - Yammer checkin script
#!/usr/bin/ruby
# gem install things-client --source http://gemcutter.org
# gem install broadcast
require 'rubygems'
require 'things'
require 'broadcast'
Broadcast.setup do |config|
config.yammer.consumer_key = ''
config.yammer.consumer_secret = ''
config.yammer.access_token = ''
config.yammer.access_secret = ''
end
module Enumerable
def inject_with_index(injected)
each_with_index{ |obj, index| injected = yield(injected, obj, index) }
injected
end
end
class Poke < Broadcast::Message
medium :yammer
def body
task_list_for_today = Things::Todo.today.map(&:name)
task_list_for_today.inject_with_index("Check in: \n") {|initial, element, index| initial += "#{index + 1}.) #{element}\n"}
end
end
Poke.new.publish
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment