This is the official Ruby interface to the API for Ketchup: A place for all your meeting notes.
gem install ketchup
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('email@example.com', 'password')
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
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 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 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
Your profile object allows you to change the email, name and timezone associated with that account:
profile.email = 'firstname.lastname@example.org' profile.name = 'Bazza' profile.timezone = 'Melbourne' profile.save
You can also change the password, if you so desire:
And there’s also the ability to create completely new accounts:
Ketchup::Profile.create 'email@example.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.
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).