A Ruby library to interact with the Ketchup API (http://useketchup.com)
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
features
lib
spec
tasks
.gitignore
LICENCE
README.textile
Rakefile
VERSION

README.textile

Ketchup

This is the official Ruby interface to the API for Ketchup: A place for all your meeting notes.

Installation

gem install ketchup

Usage

Everything in Ketchup comes down to the user you’re logged in as, and this library reflects that – you create a new connection and manage everything through a profile object:

profile = Ketchup.authenticate('user@domain.com', 'password')

None of the usage is particularly complex, but if you’re confused with any of the notes below, either read the documentation or the sauce.

Meetings

A profile object provides access to all your meetings simply enough:

profile.meetings.each do |meeting|
  puts meeting.title
end
meeting = profile.meetings.create 'title' => 'Important Discussion'
meeting.title = 'Nothing Important'
meeting.save

All of a meeting’s details are accesible through these meeting objects.

meeting.location #=> 'Abbey Road'
meeting.attendees #=> 'John, Paul, George and Ringo'

Meeting dates are parsed from natural language, just like in Ketchup’s web interface.

meeting.date = 'Tomorrow at 4pm'

You can also filter meetings by the same categories as the web interface:

profile.meetings.today
profile.meetings.upcoming
profile.meetings.previous

Items

Agenda items can be manipulated for each meeting. They’re pretty slim objects through – the only editable attribute is their content.

meeting.items.each do |item|
  puts item.content
end
item = meeting.items.build 'content' => 'What are we talking about?'
item.content = 'Minutes from Last Meeting'
item.save

You can also re-order a full set of items for a given meeting:

meeting.items.reorder item_b, item_c, item_a

Notes

Notes are the bullet points under each item, and behave in much the same way. Also, the only piece of information that they have of any interest is the content attribute.

item.notes.each do |note|
  puts note.content
end
note = item.notes.create 'content' => 'Are we done yet?'
note.content = 'Next meeting will be shorter'
note.save

Just like with items, you can re-order a full set of notes:

item.notes.reorder note_b, note_c, note_a

Projects

Projects are implicitly created through meetings:

profile.meetings.create(
  'title' => 'Monday',
  'project_name' => 'Stand ups'
)

You can access these projects through the profile object, and the meetings that are in each of them:

profile.projects.each do |project|
  puts project.name
end
project = profiles.project.first
project.meetings.each do |meeting|
  puts meeting.title
end

You can also change the names of projects through these objects:

project.name = 'Sit downs'
project.save

User Accounts

Your profile object allows you to change the email, name and timezone associated with that account:

profile.email = 'baz@foo.com'
profile.name = 'Bazza'
profile.timezone = 'Melbourne'
profile.save

You can also change the password, if you so desire:

profile.change_password '12345'

And there’s also the ability to create completely new accounts:

Ketchup::Profile.create 'who@first.base.com', 'secret',
  'name' => 'Who', 'timezone' => 'Dublin'

The name and timezone arguments are optional, though – and please note that you don’t get a profile object back from that request, but will need to authenticate like normal to get access to that account’s meetings.

Contribution

Fork and patch as you see fit – and please send pull requests if you think it’s useful for others. Don’t forget to write specs and features first, and don’t mess with the version numbers please (or at least: only do so in a different branch).

Copyright

Copyright © 2010 Pat Allan and Paul Campbell, released under an open licence.