You can manage Your Wunderlist Data like ActiveRecord with Ruby
Add this line to your application's Gemfile:
gem 'wunderlist-api'
And then execute:
$ bundle
Or install it yourself as:
$ gem install wunderlist-api
You should require this gem like;
require 'wunderlist'
# You must create API CLIENT at first.
wl = Wunderlist::API.new({
access_token: <your access token>,
client_id: <your client id>
})
# You can create Task
task = wl.new_task(LIST_NAME, {title: 'Hello World', completed: false, due_date: '2015-03-25'})
=> #<Wunderlist::Task:0x00000000000>
task.save
# You can delete Task
task.destroy
=> #<Wunderlist::Task:0x00000000000>
task.id
=> nil
# You can get Wunderlist::List Object
list = wl.list(LIST_NAME)
=> #<Wunderlist::List:0x00000000000>
# You can change List name
list.title = "IMOKENPI"
list.save
# You can get Wunderlist::Task Object Wrapped by Array
tasks = list.tasks
=> [#<Wunderlist::Task:0x00000000000>, #<Wunderlist::Task:0x11111111111>, ...]
or
tasks = wl.tasks([LIST_NAME_OR_ID_1, LIST_NAME_OR_ID_2])
=> [#<Wunderlist::Task:0x00000000000>, #<Wunderlist::Task:0x11111111111>, ...]
# You can get already completed tasks
tasks = list.tasks(completed: true)
=> [#<Wunderlist::Task:0x00000000000>, #<Wunderlist::Task:0x11111111111>, ...]
or
tasks = wl.tasks([LIST_NAME_OR_ID_1, LIST_NAME_IR_ID_2], completed: true)
=> [#<Wunderlist::Task:0x00000000000>, #<Wunderlist::Task:0x11111111111>, ...]
# You can create and update note.
note = task.note
=> #<Wunderlist::Note:0x00000000000>
note.content = "Hello World"
note.save
# You can create and update reminder.
note = task.reminder
=> #<Wunderlist::Reminder:0x00000000000>
reminder.date = "2015-07-22 17:00"
reminder.save
# You can create and update subtask.
subtask = task.new_subtask({title: "Hello World"})
=> #<Wunderlist::Subtask:0x00000000000>
subtask.save
# You can get Wunderlist::Subtask Object Wrapped by Array
subtasks = taks.subtasks
=> [#<Wunderlist::Subtask:0x00000000000>, #<Wunderlist::Subtask:0x11111111111>, ...]
- Fork it ( http://github.com/sh8/wunderlist-api/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request