GithubHelp home page GithubHelp logo

hako / blackboard-dl Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 3.0 1.16 MB

๐Ÿ“š๐Ÿ’ป Downloads lectures and workshops automagically.

License: MIT License

Crystal 100.00%
blackboard crystal downloader lectures workshops

blackboard-dl's People

Contributors

hako avatar ocelotsloth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

blackboard-dl's Issues

Time.now deprecation warnings

Compilation Warnings:

In src/cli.cr:91:16

 91 | now = Time.now
                 ^--
Warning: Deprecated Time.now. Use `Time.local` or `Time.utc` instead.

In src/cli.cr:100:44

 100 | puts "Checking new courses at #{Time.now.to_s("%T")}"
                                            ^--
Warning: Deprecated Time.now. Use `Time.local` or `Time.utc` instead.

In src/cli.cr:102:18

 102 | now = Time.now
                  ^--
Warning: Deprecated Time.now. Use `Time.local` or `Time.utc` instead.

A total of 4 warnings were found.

Everywhere Time.now is used will break at some point. Since Time.now defaults to local time my guess is that you will want that to be the new method used.

Reference

https://crystal-lang.org/api/0.32.1/Time.html#now(location:Location=Location.local):Time-class-method

Readline shard not installed

Expected Behavior

crystal build src/blackboard-dl.cr should build the application.

Actual Behavior

~/Projects/blackboard-dl master.
โฏ crystal build src/blackboard-dl.cr
Showing last frame. Use --error-trace for full trace.

In src/cli.cr:4:1

 4 | require "readline"
     ^
Error: can't find file 'readline'

If you're trying to require a shard:
- Did you remember to run `shards install`?
- Did you make sure you're running the compiler in the same directory as your shard.yml?

Versions

OS: Arch Linux
Crystal Version:

โฏ crystal -v
Crystal 0.32.1 (2019-12-18)

LLVM: 9.0.0
Default target: x86_64-pc-linux-gnu

Thoughts

It looks like the readline package was removed from the core distribution at some point and into its own shard. I believe adding the dependency should take care of it.

Logging in daemon mode.

blackboard-dl currently prints to stdout when in daemon mode, which is a bit silly.

Would be great to log output to a file instead.

CLIENT: Undefined constant XML::Type::ELEMENT_NODE

Expected Behavior

crystal build src/blackboard-dl.cr should build the application.

Actual Behavior

~/Projects/blackboard-dl issue-4.
โฏ crystal build src/blackboard-dl.cr    
Showing last frame. Use --error-trace for full trace.

In src/blackboard-dl/client.cr:169:30

 169 | if inner.type == XML::Type::ELEMENT_NODE
                        ^----------------------
Error: undefined constant XML::Type::ELEMENT_NODE

Versions

OS: Arch Linux
Crystal Version:

โฏ crystal -v
Crystal 0.32.1 (2019-12-18)

LLVM: 9.0.0
Default target: x86_64-pc-linux-gnu

Thoughts

It looks like they moved ELEMENT_NODE to XML::Node::Type::ELEMENT_NODE. Should be easy enough to fix.

Array#at no longer a valid method

Expected Behavior

crystal build src/blackboard-dl.cr should build the application.

Actual Behavior

~/Projects/blackboard-dl master*.
โฏ crystal build src/blackboard-dl.cr
Showing last frame. Use --error-trace for full trace.

In src/cli.cr:230:30

 230 | @@college = colleges.find(idx.to_s.to_i)
                            ^---
Error: 'Array(Hash(String, String))#find' is expected to be invoked with a block, but no block was given

Versions

OS: Arch Linux
Crystal Version:

โฏ crystal -v
Crystal 0.32.1 (2019-12-18)

LLVM: 9.0.0
Default target: x86_64-pc-linux-gnu

Thoughts

It looks like Iterables#at was removed at some point. I'm unfamiliar with Crystal as a language but I'm looking to see what the appropriate change is. I'm looking at the Iterables#values_at method right now but getting an error:

Error: class variable '@@college' of BlackBoard::Dl must be Hash(String, String), not Tuple(Hash(String, String))

I think I just need to get the values_at return value cast to a single value. I should have an answer pretty quickly.

Authentication does not work with mymasonportal.gmu.edu

Expected behavior

The utility would sign in and function.

Actual behavior

~/Projects/blackboard-dl testing.
โฏ ./blackboard-dl 
Blackboard course downloader v0.5.1 - [c] 2017 Wesley Hill
[!] Search for your college/university: George Mason
1 result(s) for "George Mason"
[0] George Mason University
[?] What number is your college/university?: 0
[?] Would you like to save your selected college?: y
Selected college "George Mason University" saved in "selected_college.json".

George Mason University [secure โœ”]
https://mymasonportal.gmu.edu
-Login--------------------------
[?] Blackboard username: <redacted>
[?] Blackboard password (hidden): 
[+] Logging in...Login incorrect, please check your credentials and college and try again.
Hint: The college you selected was: George Mason University

Thoughts

My best guess is that the issue lies with how George Mason University performs authentication with their Blackboard installation. Rather than using the built in authentication methods they have set up Shibboleth for single sign on authentication.

I believe the best way forward would be to provide a way to manually provide session cookies. If you have better ideas that would be super.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.