/perican

Resource Data Retriever

Primary LanguageRubyMIT LicenseMIT

perican

perican is a CLI tool to retrieve data from some applications

Table of Contents

Install for developers

Current code is a very alpha and kind of proof-of-concept demonstration. We recommend you not to install via usual gem-style procedure.

  1. Install rbenv + ruby-build (see https://github.com/sstephenson/rbenv#basic-github-checkout for details)
    $ git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
    $ git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
    # Edit your shell dot files to add some path and environment variables.
        
  2. Install Latest Ruby and bundler
    # Install ruby 2.2.1
    $ rbenv install 2.2.1
    
    # Installation check
    $ rbenv global 2.2.1
    $ ruby -v # -> You will see: ruby 2.2.1...
    
    # Install bundler for your new Ruby
    $ gem install bundler
    $ rbenv rehash
    
    # Get back to your sytem default Ruby if you want
    $ rbenv global system # say, /usr/bin/ruby
    $ ruby -v
        
  3. Clone perican from github
    $ git clone git@github.com:nomlab/perican.git ~/src/perican
        
  4. Set default ruby version in perican project
    $ cd ~/src/perican
    $ echo '2.2.1' > .ruby-version
    $ ruby -v # -> You will see: ruby 2.2.1...
        
  5. Install requied gem packages
    $ cd ~/src/perican
    $ bundle install --path vendor/bundle
        
  6. Setup config.yml
    $ cd ~/src/perican
    $ mkdir -p ~/.config/perican
    $ cp examples/config.yml ~/.config/perican/config.yml
    $ vim ~/.config/perican/config.yml # Detail is explained in next section
        

Setup config.yml

OAUTH

OAUTH:
  GOOGLE:
    CLIENT_ID: "XXXXXXXXXXXXXXXXXXXXXX" # Get client id from https://console.developers.google.com
    CLIENT_SECRET: "XXXXXXXXXXXXXXXXXX" # Get client secret from https://console.developers.google.com

Gmail

MAIL:
  LOGIN: "xxxxxxxxxxxxxxx@gmail.com" # Your gmail address
  PASSWD: "XXXXXXXXXXXXXXXXX"        # Your google passward
  SERVER: "imap.gmail.com"           # Do not touch

Evernote

EVERNOTE:
  CONSUMER_KEY: "XXXXXXXXXXXX"
  CONSUMER_SECRET: "XXXXXXXXXXXXXXXXXXXXX"
  ACCESS_TOKEN: "S=XX:U=XXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

Slack

SLACK:
  TEAM: "XXXXXXX"                                       # Your slack team name
  TOKEN: "xoxp-XXXXXXXXXX-XXXXXXXXXX-XXXXXXXXXX-XXXXXX" # Get token from https://api.slack.com/web
  CHANNEL: "#general"                                   # perican gets message from this channel
  USERNAME: "XXXXXXXXXXXXXXXXXXXXXXX"                   # Your user name
  COUNT: 20                                             # The number of messages to retrieve at a time

Toggl

TOGGL:
  TOKEN: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" # Get your API token from https://www.toggl.com/app/profile

Event

EVENT:
  CALENDAR_ID:                        # Get calendar id from calendar settings
   - "XXXXXXXXXXXXXXXXXXXX"
   - "XXXXXXXXXXXXXXXXXXXX"
   - "XXXXXXXXXXXXXXXXXXXX"
  USER_ID: "XXXXXXXXXXXXXX@gmail.com" # Your google account id