Project

exist

0.0
No commit activity in last 3 years
No release in over 3 years
Ruby client for the Exist life-tracking/correlation platform API (http://exist.io)
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.0
>= 0.8.2
>= 0.10.1
~> 0.8
~> 2.4
>= 0.32.1
>= 0.10.0
>= 1.21.0
~> 0.8

Runtime

 Project Readme

Exist API Ruby Client

Gem Version Build Status Coverage Status Dependency Status Code Climate

Disclaimer

Please notice that the Exist.IO API is experimental as noticed by their developers, so it's this library by extension, I'm not affiliated with the Exist development team, I'm just another user of the platform addicted to the quantified-self concept ;)

Installation

Add this line to your application's Gemfile:

gem 'exist'

And then execute:

$ bundle

Or install it yourself as:

$ gem install exist

Usage

Authentication

All (if not most) requests require authentication. Exist uses a non-expiring token that you can configure this client with. It also supports username and password login, although I'd recommend not to store this and use the token instead.

You can login with username & password:

exist = Exist::API.new(username: 'youruser', password: 'yourpass')

Then retrieve the token:

exist.api_key

You can store it somewhere safe, it will try to read from the EXIST_API_TOKEN environment variable if you initialize the client without options. You can also pass it directly, as you would have expected:

Exist::API.new(token: "<YOUR_TOKEN>")

Data methods

From then on, you have access to all of the current endpoints (more information in the developer's site), through the client instance:

  • The current user (#me).
  • Overviews (i.e. Today view) (#overview).
  • Attributes (#attributes, #attribute).
  • Insights (#insights, #insights_for_attribute).
  • Averages (#averages, #averages_for_attribute).
  • Correlations (#correlations).

Notice that most endpoints can only be used with the current user, hence they don't ask for username, I will update this in the future if this changes.

Roadmap

I intent to make this gem more AR-friendly, with finders, queries, deep search, to fill the gaps from the API itself.

Contributing

  1. Fork it ( https://github.com/blackxored/exist/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request