Package: bb-unsucked
Blackboard Unsuckedcrummy name for a fix of crummy softwareIf you are a student or faculty at ODU I'm sure you're no stranger
to wasting 2-3 hours a day trying to find or post assignments via BlackBoard.I am concerned with the student's view, but I hope this experiment can
prove useful for professors as well. The goal is to wrap around existing
BlackBoard infrastructure and provide a CLI API to access all the important functions
which usually are trapped behind 4-5 links and a total 20-30 second browser load time.Specific GoalsLogin to BBList classes for the current semester only (hide irrelevant ones)List all announcementsList assignments for a given classThis will have to be sort of intelligent as professors put assignments in different placesSubmit files for assignmentsView/Post to discussion boardsCaching and Daemon operation, to prevent having to hit the network for most data accessDependenciesPython3requests, andBeautifulSoup, both of which can be
installed viapip3UsageThe fastest setup is to save a.harfile of a recent Blackboard session someplace,
then run# Install the packagepip3install--userbb_unsucked# Read authentication details from .harpython3-mbb_unsuckedbuild-cachedownloads/my-session.har# use the __main__.py program to list all of your classespython3-mbb_unsuckedlsin a scriptthe filedemo_usage_in_script.pyhas more examples, but the hello world is:importbb_unsuckedbb=bb_unsucked.BBUnsucked()formy_classinbb.classes():print(f"I am in{my_class.course_id}")authenticationTo perform the authentication step the most reliable method is to
save a.harfile of a recent blackboard session.bb_unsuckedis
capable of parsing authentication session cookies out of the filerecent_request.har.Configbb-unsuckedreads from config directives first from/etc/bb-unsucked/config.iniand then from$HOME/.bb-unsucked/config.ini. Neither file need to be present,
but should you want to override a parameter the default config contents would be[DEFAULT]
base_domain = https://www.blackboard.odu.edu
cookies_file = /j/.bb-unsucked/cookies.bin
agressive_caching = False
courses_cache_file = /j/.bb-unsucked/courses-cache.bin
courses_max_cache_s = 604800
announcements_cache_file = /j/.bb-unsucked/announcements-cache.bin
announcements_max_cache_s = 21600As you can see, thebase_domaindefaults to ODU's blackboard instance,
but this can be changed to point to any blackboard instance.My config lists various cache files as being under/j/(my home dir)
because when using defaultsbb-unsuckedwill dynamically generate the
values ofcookies_file,courses_cache_file, andannouncements_cache_file.Compiling cython binarySome speed demons will want to optimize performance as much as possible, esp.
ifbb-unsuckedis going to be used in other scripts. This repo contains
a makefile which will build the binarybb-unsuckedwhen you executemake bb-unsucked.The binary outperforms the python module most effectively when reading
cached data which requires no network access. It does this by inserting some code,cython_main_interpose.c, in the generated.cfile that Cython outputs.This code is responsible for trying to perform simple tasks without
the need to jump into a python runtime. good examples are printing help text and listing classes,
which the module takes 200ms doing and the binary takes 2ms to do.