luminus_api 0.1.7 copy "luminus_api: ^0.1.7" to clipboard
luminus_api: ^0.1.7 copied to clipboard

outdated

A library for Dart developers who's in need of LumiNUS API. Currently includes implementation of LumiNUS OpenID Connect authentication flow and automated renewal of access tokens, retrieval and data a [...]

A library for Dart developers who's in need of LumiNUS API.

Created from templates made available by Stagehand under a BSD-style license.

Usage #

A simple usage example:

import 'package:luminus_api/luminus_api.dart';
import 'package:dotenv/dotenv.dart' show load, env;

main(List<String> args) async {
  // Remember to load the env var for the main() of your own application!
  load();
  Authentication auth = new Authentication(
      password: env['LUMINUS_PASSWORD'], username: env['LUMINUS_USERNAME']);
  var modules = await API.getModules(auth);
  for (Module mod in modules) {
    print(mod.courseName);
    print(mod.id);
    print(await API.getAnnouncements(auth, mod));
    var dirs = await API.getModuleDirectories(auth, mod);
    for(var dir in dirs) {
      var items = await API.getItemsFromDirectory(auth, dir);
      print(items);
      for(var item in items) {
        if(item is File) {
          print(await API.getDownloadUrl(auth, item));
        }
      }
    }
  }
  print(await API.getProfile(auth));
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

0
likes
0
pub points
19%
popularity

Publisher

unverified uploader

A library for Dart developers who's in need of LumiNUS API. Currently includes implementation of LumiNUS OpenID Connect authentication flow and automated renewal of access tokens, retrieval and data abstrcation of announcements, directory and files, modules and profile.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

convert, cookie_jar, dio, dotenv, html, http, meta

More

Packages that depend on luminus_api