<commit_before># Wunderlist Fog provider

Fog provider to manage www.wunderlist.com tasks using the familiar
[Fog](http://fog.io) interface.

The Wunderlist Fog provider was created to prove myself that creating 
an isolated Fog provider without modifying Fog itself is possible nowadays.

The provider is fully functional an only depends on Fog. Note that
Wunderlist does not provide a public API so the API might change at
any time breaking this library.

fog-wunderlist is based on the excellent work from 
https://github.com/bsmt/wunderpy and some API request sniffing
done by myself.

## Installation

    gem install fog-wunderlist

## Connecting to Wunderlist

```ruby

require 'fog/wunderlist'
require 'pp'

service = Fog::Tasks.new :provider => 'Wunderlist',
                         :wunderlist_username => '<EMAIL>',
                         :wunderlist_password => '<PASSWORD>'

```

## Managing tasks

```ruby

# Listing tasks
service.tasks.each do |task|
  pp task # => 
  # <Fog::Tasks::Wunderlist::Task
  #   id="ACQSAACGzsM",
  #   recurrence_count=0,
  #   assignee_id=nil,
  #   user_id="AAQSAAAHQGM",
  #   title="Tap to open me",
  #   recurring_parent_id=nil,
  #   note="",
  #   parent_id=nil,
  #   version=5,
  #   list_id="inbox",
  #   type="Task",
  #   owner_id="AAQSAAAHQGM",
  #   created_by_id=nil,
  #   due_date=nil,
  #   created_at=2012-12-06 14:32:31 UTC,
  #   completed_at=2012-12-06 14:32:31 UTC,
  #   updated_at=2012-12-06 14:32:31 UTC,
  #   local_identifier=nil,
  #   position=0.0,
  #   starred=true
  # >
end

# Creating a new Task in my 'Home' list
list = service.lists.find { |l| l.title == 'Home' }
service.tasks.create :title => 'test task',
                     :starred => true,
                     :list_id => list.id

# There's a special list named 'inbox' also
# that is not listed but we can use
service.tasks.create :title => 'test task',
                     :starred => true,
                     :list_id => 'inbox'

# Updating a task
task = service.tasks.find { |t| t.title == 'my task' } 
task.note = 'some random notes'
task.starred = true
task.save

# Deleting the task
task.destroy
```

## Managing lists

```
# List all the lists (inbox isn't listed)
service.lists.each do |list|
  pp list # =>
  #<Fog::Tasks::Wunderlist::List
  #  id="ABQSAABVlOE",
  #  title="Home",
  #  created_at=2012-12-06 00:09:15 UTC,
  #  updated_at=2013-03-28 20:53:14 UTC,
  #  version=2,
  #  local_identifier=nil,
  #  position=18.0,
  #  type="List",
  #  owner_id="AAQSAAAHQGM"
  #>
end

# Creating a new list
list = service.lists.create :title => 'new list'

# Updating the list
list.title = 'new title for the list'<commit_msg>README updated<commit_after># Wunderlist Fog provider

Fog provider to manage www.wunderlist.com tasks using the familiar
[Fog](http://fog.io) interface.

The Wunderlist Fog provider was created to prove myself that creating 
an isolated Fog provider without modifying Fog itself is possible nowadays.

The provider is fully functional an only depends on Fog. Note that
Wunderlist does not provide a public API so the API might change at
any time breaking this library.

fog-wunderlist is based on the excellent work from 
https://github.com/bsmt/wunderpy and some API request sniffing
done by myself.

## Installation

    gem install fog-wunderlist

## Connecting to Wunderlist

```ruby

require 'fog/wunderlist'
require 'pp'

service = Fog::Tasks.new :provider => 'Wunderlist',
                         :wunderlist_username => '<EMAIL>',
                         :wunderlist_password => '<PASSWORD>'

```

## Managing tasks

```ruby

# Listing tasks
service.tasks.each do |task|
  pp task # => 
  # <Fog::Tasks::Wunderlist::Task
  #   id="ACQSAACGzsM",
  #   recurrence_count=0,
  #   assignee_id=nil,
  #   user_id="AAQSAAAHQGM",
  #   title="Tap to open me",
  #   recurring_parent_id=nil,
  #   note="",
  #   parent_id=nil,
  #   version=5,
  #   list_id="inbox",
  #   type="Task",
  #   owner_id="AAQSAAAHQGM",
  #   created_by_id=nil,
  #   due_date=nil,
  #   created_at=2012-12-06 14:32:31 UTC,
  #   completed_at=2012-12-06 14:32:31 UTC,
  #   updated_at=2012-12-06 14:32:31 UTC,
  #   local_identifier=nil,
  #   position=0.0,
  #   starred=true
  # >
end

# Creating a new Task in my 'Home' list
list = service.lists.find { |l| l.title == 'Home' }
service.tasks.create :title => 'test task',
                     :starred => true,
                     :list_id => list.id

# There's a special list named 'inbox' also
# that is not listed but we can use
service.tasks.create :title => 'test task',
                     :starred => true,
                     :list_id => 'inbox'

# Updating a task
task = service.tasks.find { |t| t.title == 'my task' } 
task.note = 'some random notes'
task.starred = true
task.save

# Deleting the task
task.destroy
```

## Managing lists

```ruby
# List all the lists (inbox isn't listed)
service.lists.each do |list|
  pp list # =>
  #<Fog::Tasks::Wunderlist::List
  #  id="ABQSAABVlOE",
  #  title="Home",
  #  created_at=2012-12-06 00:09:15 UTC,
  #  updated_at=2013-03-28 20:53:14 UTC,
  #  version=2,
  #  local_identifier=nil,
  #  position=18.0,
  #  type="List",
  #  owner_id="AAQSAAAHQGM"
  #>
end

# Creating a new list
list = service.lists.create :title => 'new list'

# Updating the list
list.title = 'new title for the list'
{'fraction_non_alphanumeric': 0.12558226197130612, 'fraction_numerical': 0.029066517607602014, 'mean_word_length': 3.0179640718562872, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 35, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5035145', 'n_tokens_mistral': 2031, 'n_tokens_neox': 1887, 'n_words': 513}