Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

gyng/ivle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IVLE

version 0.0.2 β

Basic Ruby gem wrapper for NUS IVLE LAPI interface. All methods are implemented (but not tested).

This gem is in beta and is not guaranteed to work 100%. If you encounter problems, submit an issue (preferably with the bugfix) and I'll get on it.

Installation

Add this line to your application's Gemfile:

gem 'ivle'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ivle

Usage

ivle = IVLE::API.new('api_key', 'access_token')
=> #<IVLE::API:0x41e5a98 @api_key="api_key", @access_token="access_token">

# Or, pass in the username and password and retrieve the token via Mechanize

ivle = IVLE::API.new('api_key', 'username', 'password')
=> #<IVLE::API:0x4112d00 @api_key="api_key", @username="username", @password="password">

ivle.modules
=> {:Results=>[{:Announcements=>[], :Forums=>[], :Workbins=>[], :Webcasts=>[], ... }

ivle.profile_view
=> {:Results=>[{:UserID=>"My user ID", :Name=>"My Name", ...}

ivle.module_weblinks '4215f7f9-794d-4045-8d2d-0f8d2db2444f'
=> {"Results":[{"ID":"4215f7f9-794d-4045-8d2d-0f8d2db2444f","URL":"http://byob.berkeley.edu/", ... }

API Key

Log in to IVLE, then access this URL: http://ivle.nus.edu.sg/LAPI/default.aspx

Contributing

  1. Fork it
  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 new Pull Request

TODO

  • Use proper oAuth authentication
  • More specs

Tests

There is a simple RSpec in spec.

To run it: bundle exec rspec spec/api/api_spec.rb

About

Basic wrapper gem for NUS IVLE LAPI.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published