Build StatusCoverage Status

Milkpotion

milkpotion is an api wrapper for Remember the Milk written in Elixir.

Installation

Add milkpotion to your list of dependencies in mix.exs:

def deps do
  [{:milkpotion, "~> 0.0.4"}]
end

Configuration

milkpotion exposes a couple of configuration options which you might want to set in your config (either globally or per environment in config/*.exs) as well:

config :milkpotion,
  api_key: "your api key for Remember the Milk",
  shared_secret: "your shared secret",
  # Specify how many calls to the RTM api are allowed per interval;
  # the default are shown below. The interval is specified in
  # milliseconds.
  rate_limit_interval: 1_000,
  max_requests_per_interval: 1,
  # How many time should the `RateLimiter` retry the call if it still
  # receives a 503 from the RTM service?
  max_retries_if_over_rate: 5

Usage

Having properly set your api key ans shared secret, you are good to go. :)

Authentication

Build an authentication url. Call it and RTM will ask you to grant the respective permissions (here: read-only) to your app. On succes, the rtm service will then redirect you to your specified callback url with a frob attached as a query parameter.

auth_url = "read" |> Milkpotion.Base.Url.init_auth

Having the frob, your can acquire an auth token.

{:ok, %{"auth_token" => token}} = Milkpotion.Auth.get_token(frob)

Having a token at hand, you can request any method you want:

{:ok, body} = "rtm.test.echo" |> Milkpotion.Base.Url.rest(token) |> Milkpotion.Request.get

We will wrap more and more functionality of the rtm api in the future by introducing modules similiar to the Auth module (intended to wrap the rtm.auth.* methods.)

Contributing

Feature requests, bugs, and any kind of comments are always welcome.

Contributing

In general, we follow the "fork-and-pull" Git workflow.

  1. Fork the repo on GitHub
  2. Clone the project to your own machine
  3. Commit changes to your own branch
  4. Push your work back up to your fork
  5. Submit a Pull request so that we can review your changes

NOTE: Be sure to merge the latest from "upstream" before making a pull request!

Versioning

We use semantic versioning. For the versions available, see the tags on this repository.

License

This project is licensed under the MIT License - see the LICENSE.md file for details