<commit_before>KOBRA Client
============

Simple client for KOBRA.

## Requirments

* Ruby 1.9.2: kobra_client is only tested with Ruby 1.9.2, no garantees for other versions of Ruby.

## Install

Install via RubyGems

    gem install kobra_client

## Source

The source for kobra_client is available on Github:

    https://github.com/LinTek/kobra_client

### Development

kobra_client uses rspec and webmock for testing, do a `bundle install` for all the development requirements.

## Usage

kobra_client is a client to the KOBRA service at LiU (Linköpings Universitet).
A KOBRA account is needed to use this client.

### Initiate and authenticate

Get the username and API-key from your KOBRA account and use to authenticate the client.

    require 'kobra/client'
    kobra = Kobra::Client.new(:username => 'jage', :api_key => 'a9b8c7')
    # => #<Kobra::Client:0x00000101175898 @base_url="http://jage:a<EMAIL>@<EMAIL>.se/">

When we have the `kobra` instance, we can use the API.

### Lookup a LiU student

    kobra.get_student(:liu_id => 'johdoXXX')
    => {:blocked=>nil, :last_name=>"DOE", :email=>"<EMAIL>", :first_name=>"JOHN", :personal_number=>"887711-0011", :rfid_number=>"9999999999", :barcode_number=>"888888888888888", :union=>"LinTek", :liu_id=>"johdoXXX"}

## Copyright<commit_msg>Update README with Travis icon and https URL<commit_after>KOBRA Ruby Client [![Tested with Travis-CI](https://secure.travis-ci.org/LinTek/kobra_client.png)](http://travis-ci.org/#!/LinTek/kobra_client)
============

Simple client for KOBRA.

## Requirments

* Ruby 1.9.2: kobra_client is only tested with Ruby 1.9.2, no garantees for other versions of Ruby.

## Install

Install via RubyGems

    gem install kobra_client

## Source

The source for kobra_client is available on Github:

    https://github.com/LinTek/kobra_client

### Development

kobra_client uses rspec and webmock for testing, do a `bundle install` for all the development requirements.

## Usage

kobra_client is a client to the KOBRA service at LiU (Linköpings Universitet).
A KOBRA account is needed to use this client.

### Initiate and authenticate

Get the username and API-key from your KOBRA account and use to authenticate the client.

    require 'kobra/client'
    kobra = Kobra::Client.new(:username => 'jage', :api_key => 'a9b8c7')
    # => #<Kobra::Client:0x00000101175898 @base_url="https://jage:a9b8c7@kobra.ks.liu.se/">

When we have the `kobra` instance, we can use the API.

### Lookup a LiU student

    kobra.get_student(:liu_id => 'johdoXXX')
    => {:blocked=>nil, :last_name=>"DOE", :email=>"<EMAIL>", :first_name=>"JOHN", :personal_number=>"887711-0011", :rfid_number=>"9999999999", :barcode_number=>"888888888888888", :union=>"LinTek", :liu_id=>"johdoXXX"}

## Copyright
{'fraction_non_alphanumeric': 0.13557483731019523, 'fraction_numerical': 0.043745480838756325, 'mean_word_length': 4.837552742616034, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 37, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '35039', 'n_tokens_mistral': 1077, 'n_tokens_neox': 981, 'n_words': 276}